Increase moderation dashboard scenario to check back link text

This commit is contained in:
Bertocq
2017-11-15 23:17:40 +01:00
parent fdbf0b640c
commit 1c2240b2cc

View File

@@ -93,17 +93,27 @@ feature 'Moderation' do
expect(page).to_not have_link('Valuation') expect(page).to_not have_link('Valuation')
end end
scenario 'Moderation dashboard' do context 'Moderation dashboard' do
create(:moderator, user: user) background do
login_as(user) Setting['org_name'] = 'OrgName'
visit root_path end
click_link 'Moderation' after do
Setting['org_name'] = 'CONSUL'
end
expect(current_path).to eq(moderation_root_path) scenario 'Contains correct elements' do
expect(page).to have_css('#moderation_menu') create(:moderator, user: user)
expect(page).to_not have_css('#admin_menu') login_as(user)
expect(page).to_not have_css('#valuation_menu') visit root_path
click_link 'Moderation'
expect(page).to have_link('Go back to OrgName')
expect(current_path).to eq(moderation_root_path)
expect(page).to have_css('#moderation_menu')
expect(page).to_not have_css('#admin_menu')
expect(page).to_not have_css('#valuation_menu')
end
end end
end end