abuse_report_spec.rb 492 Bytes
Newer Older
1 2
require 'spec_helper'

3
describe 'Abuse reports' do
4 5 6
  let(:another_user) { create(:user) }

  before do
7
    sign_in(create(:user))
8 9
  end

10
  it 'Report abuse' do
11 12 13 14
    visit user_path(another_user)

    click_link 'Report abuse'

15
    fill_in 'abuse_report_message', with: 'This user sends spam'
16 17 18 19 20 21 22 23 24
    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