2016-07-06 17:17:20 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe "Admin::AbuseReports", feature: true, js: true do
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
|
|
|
context 'as an admin' do
|
|
|
|
describe 'if a user has been reported for abuse' do
|
|
|
|
before do
|
|
|
|
create(:abuse_report, user: user)
|
2016-07-07 19:39:45 -04:00
|
|
|
login_as :admin
|
2016-07-06 17:17:20 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
describe 'in the abuse report view' do
|
2016-07-25 14:16:19 -04:00
|
|
|
it "presents a link to the user's profile" do
|
2016-07-06 17:17:20 -04:00
|
|
|
visit admin_abuse_reports_path
|
|
|
|
|
2016-07-07 19:39:45 -04:00
|
|
|
expect(page).to have_link user.name, href: user_path(user)
|
2016-07-06 17:17:20 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'in the profile page of the user' do
|
2016-07-25 14:16:19 -04:00
|
|
|
it 'shows a link to the admin view of the user' do
|
2016-07-06 17:17:20 -04:00
|
|
|
visit user_path(user)
|
|
|
|
|
2016-07-07 19:39:45 -04:00
|
|
|
expect(page).to have_link '', href: admin_user_path(user)
|
2016-07-06 17:17:20 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|