Integrate the splash page into the general layout

* Cleanup the CSS
* Fix more views then you have fingers and toes
* Introduce position(weight) for sponsor levels
* Fix bootstrap/datatable integration
This commit is contained in:
Henne Vogelsang 2014-11-14 11:58:36 +01:00
parent 7acd16f923
commit f2cdea4f1a
56 changed files with 1191 additions and 1266 deletions

View file

@ -11,22 +11,22 @@ feature Room do
visit admin_conference_rooms_path(
conference_id: conference.short_title)
expect(page.has_content?('Room Name')).to be false
expect(page.has_content?('100')).to be false
expect(page.has_no_table?('#rooms')).to be true
# Add room
click_link 'New Room'
fill_in 'room_name', with: 'Room Name'
fill_in 'room_name', with: 'Auditorium'
fill_in 'room_size', with: '100'
click_button 'Create Room'
# Validations
expect(flash).to eq('Room successfully created.')
expect(page.has_content?('Room Name')).to be true
expect(page.has_content?('100')).to be true
within('table#rooms') do
expect(page.has_content?('Auditorium')).to be true
expect(page.assert_selector('tr', count: 2)).to be true
end
end
scenario 'updates a room', feature: true, js: true do
@ -35,17 +35,19 @@ feature Room do
visit edit_admin_conference_room_path(
conference_id: conference.short_title, id: room.id)
fill_in 'room_name', with: 'Room Name'
fill_in 'room_name', with: 'Auditorium'
fill_in 'room_size', with: '100'
click_button 'Update Room'
# Validations
expect(flash).to eq('Room successfully updated.')
expect(page.has_content?('Room Name')).to be true
expect(page.has_content?('100')).to be true
within('table#rooms') do
expect(page.has_content?('Auditorium')).to be true
expect(page.assert_selector('tr', count: 2)).to be true
end
room.reload
expect(room.name).to eq('Room Name')
expect(room.name).to eq('Auditorium')
expect(room.size).to eq(100)
end
end

View file

@ -5,37 +5,51 @@ feature SponsorshipLevel do
let!(:organizer_role) { create(:organizer_role, resource: conference) }
let!(:organizer) { create(:user, role_ids: [organizer_role.id]) }
shared_examples 'sponsorship levels' do
scenario 'adds and updates sponsorship level', feature: true, js: true do
shared_examples 'sponsorship_levels' do
scenario 'adds a sponsorship level', feature: true, js: true do
sign_in organizer
visit admin_conference_sponsorship_levels_path(
conference_id: conference.short_title)
# Add sponsorship level
click_link 'Add sponsorship_level'
expect(page.all('div.nested-fields').count == 1).to be true
page.
find('div.nested-fields:nth-of-type(1) div:nth-of-type(1) input').
set('Example sponsorship level')
expect(page.has_no_table?('#sponsorship_levels')).to be true
click_button 'Update Conference'
# Add SponsorshipLevel
click_link 'New Sponsorship Level'
fill_in 'sponsorship_level_title', with: 'Platin'
click_button 'Create Sponsorship level'
# Validations
expect(flash).to eq('Sponsorship levels were successfully updated.')
expect(find('div.nested-fields:nth-of-type(1) div:nth-of-type(1) input').
value).to eq('Example sponsorship level')
expect(flash).to eq('Sponsorship level successfully created.')
within('table#sponsorship_levels') do
expect(page.has_content?('Platin')).to be true
expect(page.assert_selector('tr', count: 2)).to be true
end
end
# Remove sponsorship level
click_link 'Remove sponsorship_level'
expect(page.all('div.nested-fields').count == 0).to be true
click_button 'Update Conference'
expect(flash).to eq('Sponsorship levels were successfully updated.')
expect(page.all('div.nested-fields').count == 0).to be true
scenario 'updates a sponsorship level', feature: true, js: true do
level = create(:sponsorship_level, conference_id: conference.id)
sign_in organizer
visit edit_admin_conference_sponsorship_level_path(
conference_id: conference.short_title, id: level.id)
fill_in 'sponsorship_level_title', with: 'Gold'
click_button 'Update Sponsorship level'
# Validations
expect(flash).to eq('Sponsorship level successfully updated.')
within('table#sponsorship_levels') do
expect(page.has_content?('Gold')).to be true
expect(page.assert_selector('tr', count: 2)).to be true
end
level.reload
expect(level.title).to eq('Gold')
end
end
describe 'organizer' do
it_behaves_like 'sponsorship levels'
it_behaves_like 'sponsorship_levels'
end
end