2019-07-25 01:24:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-11-22 04:32:48 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-03 14:08:28 -04:00
|
|
|
RSpec.describe 'Abuse reports' do
|
2016-11-22 04:32:48 -05:00
|
|
|
let(:another_user) { create(:user) }
|
|
|
|
|
|
|
|
before do
|
2017-06-21 19:44:10 -04:00
|
|
|
sign_in(create(:user))
|
2016-11-22 04:32:48 -05:00
|
|
|
end
|
|
|
|
|
2018-07-05 02:32:05 -04:00
|
|
|
it 'Report abuse' do
|
2016-11-22 04:32:48 -05:00
|
|
|
visit user_path(another_user)
|
|
|
|
|
|
|
|
click_link 'Report abuse'
|
|
|
|
|
2017-06-27 16:43:02 -04:00
|
|
|
fill_in 'abuse_report_message', with: 'This user sends spam'
|
2016-11-22 04:32:48 -05:00
|
|
|
click_button 'Send report'
|
|
|
|
|
|
|
|
expect(page).to have_content 'Thank you for your report'
|
|
|
|
|
|
|
|
visit user_path(another_user)
|
|
|
|
|
|
|
|
expect(page).to have_button("Already reported for abuse")
|
|
|
|
end
|
|
|
|
end
|