mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-15 20:54:03 +00:00
Implement consistent admin interface
* Consistent route/model/controller/view layout * Get rid of unused photos, speakers, dietchoices, social_events controllers * Drop unused :public from Rooms and :description from CallForPapers
This commit is contained in:
parent
f6a87331be
commit
28063129c7
133 changed files with 1461 additions and 1461 deletions
|
|
@ -6,47 +6,47 @@ feature DifficultyLevel do
|
|||
let!(:organizer) { create(:user, role_ids: [organizer_role.id]) }
|
||||
|
||||
shared_examples 'difficulty levels' do
|
||||
scenario 'adds and updates difficulty level', feature: true, js: true do
|
||||
scenario 'adds difficulty level', feature: true, js: true do
|
||||
|
||||
sign_in organizer
|
||||
visit admin_conference_difficulty_levels_path(
|
||||
conference_id: conference.short_title)
|
||||
|
||||
# Add difficulty level
|
||||
click_link 'Add difficulty_level'
|
||||
expect(page.all('div.nested-fields').count == 1).to be true
|
||||
click_link 'Add Difficulty Level'
|
||||
|
||||
page.
|
||||
find('div.nested-fields:nth-of-type(1) div:nth-of-type(1) input').
|
||||
set('Example difficulty level')
|
||||
page.
|
||||
find('div.nested-fields:nth-of-type(1) div:nth-of-type(2) textarea').
|
||||
set('Example difficulty level description')
|
||||
page.
|
||||
find('div.nested-fields:nth-of-type(1) div:nth-of-type(3) input').
|
||||
set('#ff0000')
|
||||
fill_in 'difficulty_level_title', with: 'Hard'
|
||||
fill_in 'difficulty_level_description', with: 'Life is the hardest'
|
||||
page.find('#difficulty_level_color').set('#ff0000')
|
||||
|
||||
click_button 'Update Conference'
|
||||
click_button 'Create Difficulty level'
|
||||
|
||||
# Validations
|
||||
expect(flash).to eq('Difficulty Levels were successfully updated.')
|
||||
expect(
|
||||
find('div.nested-fields:nth-of-type(1) div:nth-of-type(1) input').
|
||||
value).to eq('Example difficulty level')
|
||||
expect(
|
||||
find('div.nested-fields:nth-of-type(1) div:nth-of-type(2) textarea').
|
||||
value).to eq('Example difficulty level description')
|
||||
expect(
|
||||
find('div.nested-fields:nth-of-type(1) div:nth-of-type(3) input').
|
||||
value).to eq('#ff0000')
|
||||
expect(flash).to eq('Difficulty level successfully created.')
|
||||
within('table#difficulty_levels') do
|
||||
expect(page.has_content?('Hard')).to be true
|
||||
expect(page.has_content?('Life is the hardest')).to be true
|
||||
expect(page.assert_selector('tr', count: 2)).to be true
|
||||
end
|
||||
end
|
||||
|
||||
scenario 'updates difficulty level', feature: true, js: true do
|
||||
|
||||
conference.difficulty_levels << create(:difficulty_level)
|
||||
sign_in organizer
|
||||
visit admin_conference_difficulty_levels_path(
|
||||
conference_id: conference.short_title)
|
||||
|
||||
# Remove difficulty level
|
||||
click_link 'Remove difficulty_level'
|
||||
expect(page.all('div.nested-fields').count == 0).to be true
|
||||
click_button 'Update Conference'
|
||||
expect(flash).to eq('Difficulty Levels were successfully updated.')
|
||||
expect(page.all('div.nested-fields').count == 0).to be true
|
||||
click_link 'Delete'
|
||||
|
||||
# Validations
|
||||
expect(flash).to eq('Difficulty level successfully deleted.')
|
||||
within('table#difficulty_levels') do
|
||||
expect(page.assert_selector('tr', count: 1)).to be true
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
describe 'organizer' do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue