osem-fcy/spec/features/tracks_spec.rb
AEtherC0r3 3d250ecf75 UI/UX changes related to tracks
Add confirmed and cfp_active scopes to Track
Render markdown in track's description
Make the views more similar to the proposal/events views
Change the sequence of columns in admin/Tracks#index
Remove the short_name column from the index views
Add button "My Tracks" in the user menu
Fix track count in proposals
Add details of track in admin/Tracks#show
Use tabs to show track details and events
2017-08-11 16:25:21 +03:00

71 lines
2.4 KiB
Ruby

require 'spec_helper'
feature Track do
let!(:conference) { create(:conference) }
let!(:organizer_role) { Role.find_by(name: 'organizer', resource: conference) }
let!(:organizer) { create(:user, role_ids: [organizer_role.id]) }
shared_examples 'tracks' do
scenario 'adds a track', feature: true, js: true do
sign_in organizer
visit admin_conference_program_tracks_path(conference_id: conference.short_title)
click_link 'New Track'
fill_in 'track_name', with: 'Distribution'
fill_in 'track_short_name', with: 'Distribution'
page.find('#track_color').set('#B94D4D')
fill_in 'track_description', with: 'Events about our Linux distribution'
click_button 'Create Track'
expect(flash).to eq('Track successfully created.')
within('table#tracks') do
expect(page.has_content?('Distribution')).to be true
expect(page.has_content?('Events about our Linux')).to be true
expect(page.assert_selector('tr', count: 2)).to be true
end
end
scenario 'deletes a track', feature: true, js: true do
track = create(:track, program_id: conference.program.id)
sign_in organizer
visit admin_conference_program_tracks_path(conference_id: conference.short_title)
click_link 'Delete'
expect(flash).to eq('Track successfully deleted.')
within('table#tracks') do
expect(page.has_content?(track.name)).to be false
expect(page.has_content?(track.description)).to be false
expect(page.has_content?('No data available in table')).to eq true
end
end
scenario 'updates a track', feature: true, js: true do
create(:track, program_id: conference.program.id)
sign_in organizer
visit admin_conference_program_tracks_path(conference_id: conference.short_title)
click_link 'Edit'
fill_in 'track_name', with: 'Distribution'
fill_in 'track_short_name', with: 'Distribution'
page.find('#track_color').set('#B94D4D')
fill_in 'track_description', with: 'Events about our Linux distribution'
click_button 'Update Track'
expect(flash).to eq('Track successfully updated.')
within('table#tracks') do
expect(page.has_content?('Distribution')).to be true
expect(page.has_content?('Events about our Linux')).to be true
expect(page.assert_selector('tr', count: 2)).to be true
end
end
end
describe 'organizer' do
it_behaves_like 'tracks'
end
end