BigW Consortium Gitlab

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

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

  before do
7
    sign_in(create(:user))
8 9 10 11 12 13 14
  end

  scenario 'Report abuse' do
    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