2019-07-25 05:24:42 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-11-22 09:32:48 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-03 18:08:28 +00:00
|
|
|
RSpec.describe 'Abuse reports' do
|
2016-11-22 09:32:48 +00:00
|
|
|
let(:another_user) { create(:user) }
|
|
|
|
|
|
|
|
before do
|
2017-06-21 23:44:10 +00:00
|
|
|
sign_in(create(:user))
|
2016-11-22 09:32:48 +00:00
|
|
|
end
|
|
|
|
|
2020-12-09 18:09:48 +00:00
|
|
|
it 'report abuse' do
|
2016-11-22 09:32:48 +00:00
|
|
|
visit user_path(another_user)
|
|
|
|
|
|
|
|
click_link 'Report abuse'
|
|
|
|
|
2017-06-27 20:43:02 +00:00
|
|
|
fill_in 'abuse_report_message', with: 'This user sends spam'
|
2016-11-22 09:32:48 +00: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
|