2015-08-06 10:57:04 -04:00
|
|
|
class Spinach::Features::AbuseReports < Spinach::FeatureSteps
|
|
|
|
include SharedAuthentication
|
|
|
|
|
|
|
|
step 'I visit "Mike" user page' do
|
|
|
|
visit user_path(user_mike)
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I click "Report abuse" button' do
|
|
|
|
click_link 'Report abuse'
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I fill and submit abuse form' do
|
|
|
|
fill_in 'abuse_report_message', with: 'This user send spam'
|
|
|
|
click_button 'Send report'
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see success message' do
|
|
|
|
page.should have_content 'Thank you for your report'
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'user "Mike" exists' do
|
|
|
|
user_mike
|
|
|
|
end
|
|
|
|
|
2015-09-29 12:08:55 -04:00
|
|
|
step 'I should see a red "Report abuse" button' do
|
2015-10-16 07:24:28 -04:00
|
|
|
expect(page).to have_button("Already reported for abuse")
|
2015-09-28 10:00:53 -04:00
|
|
|
end
|
|
|
|
|
2015-08-06 10:57:04 -04:00
|
|
|
def user_mike
|
|
|
|
@user_mike ||= create(:user, name: 'Mike')
|
|
|
|
end
|
|
|
|
end
|