Rename 'ConferenceController' to 'ConferencesController', and 'ProposalController' to 'ProposalsController'
This commit is contained in:
parent
0b6550d060
commit
daf1f805bd
71 changed files with 225 additions and 191 deletions
|
|
@ -1,6 +1,6 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Admin::ConferenceController do
|
||||
describe Admin::ConferencesController do
|
||||
|
||||
# It is necessary to use bang version of let to build roles before user
|
||||
let(:conference) { create(:conference, end_date: Date.new(2014, 05, 26) + 15) }
|
||||
|
|
|
|||
38
spec/controllers/application_controller_spec.rb
Normal file
38
spec/controllers/application_controller_spec.rb
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe ApplicationController, type: :controller do
|
||||
let(:conference) { create(:conference) }
|
||||
|
||||
describe 'user is signed in' do
|
||||
|
||||
describe 'as admin' do
|
||||
let(:admin) { create(:admin) }
|
||||
before { sign_in(admin) }
|
||||
|
||||
it 'redirects to the admin homepage' do
|
||||
expect(controller.after_sign_in_path_for(admin)).to eq admin_conferences_path
|
||||
end
|
||||
end
|
||||
|
||||
describe 'as regular user' do
|
||||
let(:user) { create(:user) }
|
||||
before { sign_in(user) }
|
||||
|
||||
context 'with no return_to value in the session' do
|
||||
it 'redirects to the root_path' do
|
||||
expect(controller.after_sign_in_path_for(user)).to eq root_path
|
||||
end
|
||||
end
|
||||
|
||||
context 'with a specific return_to value provided in the session' do
|
||||
it 'redirects to the conferences_path' do
|
||||
@request.session['return_to'] = conferences_path
|
||||
expect(controller.after_sign_in_path_for(user)).to eq conferences_path
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe ConferenceController do
|
||||
let(:conference) { create(:conference, splashpage: create(:splashpage, public: true), venue: create(:venue)) }
|
||||
describe ConferencesController do
|
||||
let(:conference) { create(:conference, splashpage: create(:splashpage, public: true), venue: create(:venue)) }
|
||||
let!(:cfp) { create(:cfp, program: conference.program) }
|
||||
let(:room) { create(:room, venue: conference.venue) }
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe ProposalController do
|
||||
describe ProposalsController do
|
||||
let(:user) { create(:user) }
|
||||
let(:conference) { create(:conference, short_title: 'lama101') }
|
||||
let(:event) { create(:event, program: conference.program) }
|
||||
|
|
@ -16,7 +16,7 @@ describe ProposalController do
|
|||
|
||||
it 'assigns user and url variables' do
|
||||
expect(assigns(:user)).to be_instance_of(User)
|
||||
expect(assigns(:url)).to eq '/conference/lama101/program/proposal'
|
||||
expect(assigns(:url)).to eq '/conferences/lama101/program/proposals'
|
||||
end
|
||||
|
||||
it 'renders new template' do
|
||||
|
|
@ -32,7 +32,7 @@ describe ProposalController do
|
|||
post :create, event: attributes_for(:event, event_type_id: event_type.id),
|
||||
conference_id: conference.short_title,
|
||||
user: attributes_for(:user)
|
||||
expect(assigns(:url)).to eq '/conference/lama101/program/proposal'
|
||||
expect(assigns(:url)).to eq '/conferences/lama101/program/proposals'
|
||||
end
|
||||
|
||||
context 'user is saved successfully' do
|
||||
|
|
@ -75,7 +75,7 @@ describe ProposalController do
|
|||
end
|
||||
|
||||
it 'redirects to proposal index path', run: true do
|
||||
expect(response).to redirect_to conference_program_proposal_index_path conference.short_title
|
||||
expect(response).to redirect_to conference_program_proposals_path conference.short_title
|
||||
end
|
||||
|
||||
it 'shows success message in flash notice', run: true do
|
||||
|
|
@ -199,7 +199,7 @@ describe ProposalController do
|
|||
|
||||
it 'assigns user and url variables' do
|
||||
expect(assigns(:user)).to be_instance_of(User)
|
||||
expect(assigns(:url)).to eq '/conference/lama101/program/proposal'
|
||||
expect(assigns(:url)).to eq '/conferences/lama101/program/proposals'
|
||||
end
|
||||
|
||||
it 'renders new template' do
|
||||
|
|
@ -214,7 +214,7 @@ describe ProposalController do
|
|||
|
||||
it 'assigns event and url variables' do
|
||||
expect(assigns(:event)).to eq event
|
||||
expect(assigns(:url)).to eq "/conference/lama101/program/proposal/#{event.id}"
|
||||
expect(assigns(:url)).to eq "/conferences/lama101/program/proposals/#{event.id}"
|
||||
end
|
||||
|
||||
it 'renders edit template' do
|
||||
|
|
@ -229,7 +229,7 @@ describe ProposalController do
|
|||
it 'assigns url variables' do
|
||||
post :create, event: attributes_for(:event, event_type_id: event_type.id),
|
||||
conference_id: conference.short_title
|
||||
expect(assigns(:url)).to eq '/conference/lama101/program/proposal'
|
||||
expect(assigns(:url)).to eq '/conferences/lama101/program/proposals'
|
||||
end
|
||||
|
||||
context 'creates proposal successfully' do
|
||||
|
|
@ -252,7 +252,7 @@ describe ProposalController do
|
|||
end
|
||||
|
||||
it 'redirects to proposal index path', run: true do
|
||||
expect(response).to redirect_to conference_program_proposal_index_path conference.short_title
|
||||
expect(response).to redirect_to conference_program_proposals_path conference.short_title
|
||||
end
|
||||
|
||||
it 'shows success message in flash notice', run: true do
|
||||
|
|
@ -298,7 +298,7 @@ describe ProposalController do
|
|||
patch :update, event: attributes_for(:event, title: 'some title', event_type_id: event_type.id),
|
||||
conference_id: conference.short_title,
|
||||
id: event.id
|
||||
expect(assigns(:url)).to eq "/conference/lama101/program/proposal/#{event.id}"
|
||||
expect(assigns(:url)).to eq "/conferences/lama101/program/proposals/#{event.id}"
|
||||
end
|
||||
|
||||
context 'updates successfully' do
|
||||
|
|
@ -314,7 +314,7 @@ describe ProposalController do
|
|||
end
|
||||
|
||||
it 'redirects to proposal index path' do
|
||||
expect(response).to redirect_to conference_program_proposal_index_path conference.short_title
|
||||
expect(response).to redirect_to conference_program_proposals_path conference.short_title
|
||||
end
|
||||
|
||||
it 'shows success message in flash notice' do
|
||||
|
|
@ -349,7 +349,7 @@ describe ProposalController do
|
|||
|
||||
it 'assigns url variable' do
|
||||
patch :withdraw, conference_id: conference.short_title, id: event.id
|
||||
expect(assigns(:url)).to eq "/conference/lama101/program/proposal/#{event.id}"
|
||||
expect(assigns(:url)).to eq "/conferences/lama101/program/proposals/#{event.id}"
|
||||
end
|
||||
|
||||
context 'withdraws successfully' do
|
||||
|
|
@ -363,7 +363,7 @@ describe ProposalController do
|
|||
end
|
||||
|
||||
it 'redirects to proposal index path' do
|
||||
expect(response).to redirect_to conference_program_proposal_index_path conference.short_title
|
||||
expect(response).to redirect_to conference_program_proposals_path conference.short_title
|
||||
end
|
||||
|
||||
it 'shows success message in flash notice' do
|
||||
|
|
@ -404,7 +404,7 @@ describe ProposalController do
|
|||
end
|
||||
|
||||
it 'redirects to proposal index path' do
|
||||
expect(response).to redirect_to conference_program_proposal_index_path conference.short_title
|
||||
expect(response).to redirect_to conference_program_proposals_path conference.short_title
|
||||
end
|
||||
|
||||
it 'shows error in flash message' do
|
||||
|
|
@ -426,7 +426,7 @@ describe ProposalController do
|
|||
end
|
||||
|
||||
it 'assigns url variable' do
|
||||
expect(assigns(:url)).to eq "/conference/lama101/program/proposal/#{event.id}"
|
||||
expect(assigns(:url)).to eq "/conferences/lama101/program/proposals/#{event.id}"
|
||||
end
|
||||
|
||||
it 'change state of event to confirmed' do
|
||||
|
|
@ -439,7 +439,7 @@ describe ProposalController do
|
|||
before { patch :confirm, conference_id: conference.short_title, id: event.id }
|
||||
|
||||
it 'assigns url variable' do
|
||||
expect(assigns(:url)).to eq "/conference/lama101/program/proposal/#{event.id}"
|
||||
expect(assigns(:url)).to eq "/conferences/lama101/program/proposals/#{event.id}"
|
||||
end
|
||||
|
||||
it 'change state of event to confirmed' do
|
||||
|
|
@ -455,7 +455,7 @@ describe ProposalController do
|
|||
end
|
||||
|
||||
it 'redirects to proposal index path' do
|
||||
expect(response).to redirect_to conference_program_proposal_index_path conference.short_title
|
||||
expect(response).to redirect_to conference_program_proposals_path conference.short_title
|
||||
end
|
||||
|
||||
it 'shows success message in flash notice' do
|
||||
|
|
@ -510,7 +510,7 @@ describe ProposalController do
|
|||
end
|
||||
|
||||
it 'redirects to proposal index path' do
|
||||
expect(response).to redirect_to conference_program_proposal_index_path conference.short_title
|
||||
expect(response).to redirect_to conference_program_proposals_path conference.short_title
|
||||
end
|
||||
|
||||
it 'shows error in flash message' do
|
||||
|
|
@ -524,7 +524,7 @@ describe ProposalController do
|
|||
|
||||
it 'assigns url variable' do
|
||||
patch :restart, conference_id: conference.short_title, id: event.id
|
||||
expect(assigns(:url)).to eq "/conference/lama101/program/proposal/#{event.id}"
|
||||
expect(assigns(:url)).to eq "/conferences/lama101/program/proposals/#{event.id}"
|
||||
end
|
||||
|
||||
context 'resubmits successfully' do
|
||||
|
|
@ -538,7 +538,7 @@ describe ProposalController do
|
|||
end
|
||||
|
||||
it 'redirects to proposal index path' do
|
||||
expect(response).to redirect_to conference_program_proposal_index_path conference.short_title
|
||||
expect(response).to redirect_to conference_program_proposals_path conference.short_title
|
||||
end
|
||||
|
||||
it 'shows success message in flash notice' do
|
||||
|
|
@ -558,7 +558,7 @@ describe ProposalController do
|
|||
end
|
||||
|
||||
it 'redirects to proposal index path' do
|
||||
expect(response).to redirect_to conference_program_proposal_index_path conference.short_title
|
||||
expect(response).to redirect_to conference_program_proposals_path conference.short_title
|
||||
end
|
||||
|
||||
it 'shows error in flash message' do
|
||||
|
|
@ -578,7 +578,7 @@ describe ProposalController do
|
|||
end
|
||||
|
||||
it 'redirects to proposal index path' do
|
||||
expect(response).to redirect_to conference_program_proposal_index_path conference.short_title
|
||||
expect(response).to redirect_to conference_program_proposals_path conference.short_title
|
||||
end
|
||||
|
||||
it 'shows error in flash message' do
|
||||
|
|
@ -34,28 +34,28 @@ feature 'Has correct abilities' do
|
|||
expect(current_path).to eq(admin_conference_path(conference1.short_title))
|
||||
|
||||
expect(page).to have_selector('li.nav-header.nav-header-bigger a', text: 'Dashboard')
|
||||
expect(page).to have_link('Basics', href: "/admin/conference/#{conference1.short_title}/edit")
|
||||
expect(page).to have_link('Contact', href: "/admin/conference/#{conference1.short_title}/contact/edit")
|
||||
expect(page).to have_link('Commercials', href: "/admin/conference/#{conference1.short_title}/commercials")
|
||||
expect(page).to have_link('Events', href: "/admin/conference/#{conference1.short_title}/program/events")
|
||||
expect(page).to have_link('Registrations', href: "/admin/conference/#{conference1.short_title}/registrations")
|
||||
expect(page).to have_link('Schedules', href: "/admin/conference/#{conference1.short_title}/schedules")
|
||||
expect(page).to have_link('Campaigns', href: "/admin/conference/#{conference1.short_title}/campaigns")
|
||||
expect(page).to have_link('Goals', href: "/admin/conference/#{conference1.short_title}/targets")
|
||||
expect(page).to have_link('Venue', href: "/admin/conference/#{conference1.short_title}/venue")
|
||||
expect(page).to have_link('Rooms', href: "/admin/conference/#{conference1.short_title}/venue/rooms")
|
||||
expect(page).to have_link('Lodgings', href: "/admin/conference/#{conference1.short_title}/lodgings")
|
||||
expect(page).to have_link('Sponsorship', href: "/admin/conference/#{conference1.short_title}/sponsorship_levels")
|
||||
expect(page).to have_link('Sponsors', href: "/admin/conference/#{conference1.short_title}/sponsors")
|
||||
expect(page).to have_link('Tickets', href: "/admin/conference/#{conference1.short_title}/tickets")
|
||||
expect(page).to have_link('E-Mails', href: "/admin/conference/#{conference1.short_title}/emails")
|
||||
expect(page).to have_link('Program', href: "/admin/conference/#{conference1.short_title}/program")
|
||||
expect(page).to have_link('Call for Papers', href: "/admin/conference/#{conference1.short_title}/program/cfp")
|
||||
expect(page).to have_link('Tracks', href: "/admin/conference/#{conference1.short_title}/program/tracks")
|
||||
expect(page).to have_link('Event Types', href: "/admin/conference/#{conference1.short_title}/program/event_types")
|
||||
expect(page).to have_link('Difficulty Levels', href: "/admin/conference/#{conference1.short_title}/program/difficulty_levels")
|
||||
expect(page).to have_link('Questions', href: "/admin/conference/#{conference1.short_title}/questions")
|
||||
expect(page).to have_link('Roles', href: "/admin/conference/#{conference1.short_title}/roles")
|
||||
expect(page).to have_link('Basics', href: "/admin/conferences/#{conference1.short_title}/edit")
|
||||
expect(page).to have_link('Contact', href: "/admin/conferences/#{conference1.short_title}/contact/edit")
|
||||
expect(page).to have_link('Commercials', href: "/admin/conferences/#{conference1.short_title}/commercials")
|
||||
expect(page).to have_link('Events', href: "/admin/conferences/#{conference1.short_title}/program/events")
|
||||
expect(page).to have_link('Registrations', href: "/admin/conferences/#{conference1.short_title}/registrations")
|
||||
expect(page).to have_link('Schedules', href: "/admin/conferences/#{conference1.short_title}/schedules")
|
||||
expect(page).to have_link('Campaigns', href: "/admin/conferences/#{conference1.short_title}/campaigns")
|
||||
expect(page).to have_link('Goals', href: "/admin/conferences/#{conference1.short_title}/targets")
|
||||
expect(page).to have_link('Venue', href: "/admin/conferences/#{conference1.short_title}/venue")
|
||||
expect(page).to have_link('Rooms', href: "/admin/conferences/#{conference1.short_title}/venue/rooms")
|
||||
expect(page).to have_link('Lodgings', href: "/admin/conferences/#{conference1.short_title}/lodgings")
|
||||
expect(page).to have_link('Sponsorship', href: "/admin/conferences/#{conference1.short_title}/sponsorship_levels")
|
||||
expect(page).to have_link('Sponsors', href: "/admin/conferences/#{conference1.short_title}/sponsors")
|
||||
expect(page).to have_link('Tickets', href: "/admin/conferences/#{conference1.short_title}/tickets")
|
||||
expect(page).to have_link('E-Mails', href: "/admin/conferences/#{conference1.short_title}/emails")
|
||||
expect(page).to have_link('Program', href: "/admin/conferences/#{conference1.short_title}/program")
|
||||
expect(page).to have_link('Call for Papers', href: "/admin/conferences/#{conference1.short_title}/program/cfp")
|
||||
expect(page).to have_link('Tracks', href: "/admin/conferences/#{conference1.short_title}/program/tracks")
|
||||
expect(page).to have_link('Event Types', href: "/admin/conferences/#{conference1.short_title}/program/event_types")
|
||||
expect(page).to have_link('Difficulty Levels', href: "/admin/conferences/#{conference1.short_title}/program/difficulty_levels")
|
||||
expect(page).to have_link('Questions', href: "/admin/conferences/#{conference1.short_title}/questions")
|
||||
expect(page).to have_link('Roles', href: "/admin/conferences/#{conference1.short_title}/roles")
|
||||
|
||||
visit edit_admin_conference_path(conference1.short_title)
|
||||
expect(current_path).to eq(edit_admin_conference_path(conference1.short_title))
|
||||
|
|
@ -114,29 +114,29 @@ feature 'Has correct abilities' do
|
|||
expect(current_path).to eq(admin_conference_path(conference2.short_title))
|
||||
|
||||
expect(page).to have_selector('li.nav-header.nav-header-bigger a', text: 'Dashboard')
|
||||
expect(page).to_not have_link('Basics', href: "/admin/conference/#{conference2.short_title}/edit")
|
||||
expect(page).to_not have_link('Basics', href: "/admin/conferences/#{conference2.short_title}/edit")
|
||||
expect(page).to have_text('Basics')
|
||||
expect(page).to_not have_link('Contact', href: "/admin/conference/#{conference2.short_title}/contact/edit")
|
||||
expect(page).to have_link('Commercials', href: "/admin/conference/#{conference2.short_title}/commercials")
|
||||
expect(page).to have_link('Events', href: "/admin/conference/#{conference2.short_title}/program/events")
|
||||
expect(page).to_not have_link('Registrations', href: "/admin/conference/#{conference2.short_title}/registrations")
|
||||
expect(page).to_not have_link('Schedules', href: "/admin/conference/#{conference2.short_title}/schedules")
|
||||
expect(page).to_not have_link('Campaigns', href: "/admin/conference/#{conference2.short_title}/campaigns")
|
||||
expect(page).to_not have_link('Goals', href: "/admin/conference/#{conference2.short_title}/targets")
|
||||
expect(page).to have_link('Venue', href: "/admin/conference/#{conference2.short_title}/venue")
|
||||
expect(page).to have_link('Rooms', href: "/admin/conference/#{conference2.short_title}/venue/rooms")
|
||||
expect(page).to_not have_link('Lodgings', href: "/admin/conference/#{conference2.short_title}/lodgings")
|
||||
expect(page).to_not have_link('Sponsorship', href: "/admin/conference/#{conference2.short_title}/sponsorship_levels")
|
||||
expect(page).to_not have_link('Sponsors', href: "/admin/conference/#{conference2.short_title}/sponsors")
|
||||
expect(page).to_not have_link('Supporter Levels', href: "/admin/conference/#{conference2.short_title}/supporter_levels")
|
||||
expect(page).to have_link('E-Mails', href: "/admin/conference/#{conference2.short_title}/emails")
|
||||
expect(page).to have_link('Program', href: "/admin/conference/#{conference2.short_title}/program")
|
||||
expect(page).to have_link('Call for Papers', href: "/admin/conference/#{conference2.short_title}/program/cfp")
|
||||
expect(page).to have_link('Tracks', href: "/admin/conference/#{conference2.short_title}/program/tracks")
|
||||
expect(page).to have_link('Event Types', href: "/admin/conference/#{conference2.short_title}/program/event_types")
|
||||
expect(page).to have_link('Difficulty Levels', href: "/admin/conference/#{conference2.short_title}/program/difficulty_levels")
|
||||
expect(page).to_not have_link('Questions', href: "/admin/conference/#{conference2.short_title}/questions")
|
||||
expect(page).to have_link('Roles', href: "/admin/conference/#{conference2.short_title}/roles")
|
||||
expect(page).to_not have_link('Contact', href: "/admin/conferences/#{conference2.short_title}/contact/edit")
|
||||
expect(page).to have_link('Commercials', href: "/admin/conferences/#{conference2.short_title}/commercials")
|
||||
expect(page).to have_link('Events', href: "/admin/conferences/#{conference2.short_title}/program/events")
|
||||
expect(page).to_not have_link('Registrations', href: "/admin/conferences/#{conference2.short_title}/registrations")
|
||||
expect(page).to_not have_link('Schedules', href: "/admin/conferences/#{conference2.short_title}/schedules")
|
||||
expect(page).to_not have_link('Campaigns', href: "/admin/conferences/#{conference2.short_title}/campaigns")
|
||||
expect(page).to_not have_link('Goals', href: "/admin/conferences/#{conference2.short_title}/targets")
|
||||
expect(page).to have_link('Venue', href: "/admin/conferences/#{conference2.short_title}/venue")
|
||||
expect(page).to have_link('Rooms', href: "/admin/conferences/#{conference2.short_title}/venue/rooms")
|
||||
expect(page).to_not have_link('Lodgings', href: "/admin/conferences/#{conference2.short_title}/lodgings")
|
||||
expect(page).to_not have_link('Sponsorship', href: "/admin/conferences/#{conference2.short_title}/sponsorship_levels")
|
||||
expect(page).to_not have_link('Sponsors', href: "/admin/conferences/#{conference2.short_title}/sponsors")
|
||||
expect(page).to_not have_link('Supporter Levels', href: "/admin/conferences/#{conference2.short_title}/supporter_levels")
|
||||
expect(page).to have_link('E-Mails', href: "/admin/conferences/#{conference2.short_title}/emails")
|
||||
expect(page).to have_link('Program', href: "/admin/conferences/#{conference2.short_title}/program")
|
||||
expect(page).to have_link('Call for Papers', href: "/admin/conferences/#{conference2.short_title}/program/cfp")
|
||||
expect(page).to have_link('Tracks', href: "/admin/conferences/#{conference2.short_title}/program/tracks")
|
||||
expect(page).to have_link('Event Types', href: "/admin/conferences/#{conference2.short_title}/program/event_types")
|
||||
expect(page).to have_link('Difficulty Levels', href: "/admin/conferences/#{conference2.short_title}/program/difficulty_levels")
|
||||
expect(page).to_not have_link('Questions', href: "/admin/conferences/#{conference2.short_title}/questions")
|
||||
expect(page).to have_link('Roles', href: "/admin/conferences/#{conference2.short_title}/roles")
|
||||
|
||||
visit edit_admin_conference_path(conference2.short_title)
|
||||
expect(current_path).to eq(root_path)
|
||||
|
|
@ -191,29 +191,29 @@ feature 'Has correct abilities' do
|
|||
expect(current_path).to eq(admin_conference_path(conference3.short_title))
|
||||
|
||||
expect(page).to have_selector('li.nav-header.nav-header-bigger a', text: 'Dashboard')
|
||||
expect(page).to_not have_link('Basics', href: "/admin/conference/#{conference2.short_title}/edit")
|
||||
expect(page).to_not have_link('Basics', href: "/admin/conferences/#{conference2.short_title}/edit")
|
||||
expect(page).to have_text('Basics')
|
||||
expect(page).to_not have_link('Contact', href: "/admin/conference/#{conference3.short_title}/contact/edit")
|
||||
expect(page).to have_link('Commercials', href: "/admin/conference/#{conference3.short_title}/commercials")
|
||||
expect(page).to_not have_link('Events', href: "/admin/conference/#{conference3.short_title}/program/events")
|
||||
expect(page).to have_link('Registrations', href: "/admin/conference/#{conference3.short_title}/registrations")
|
||||
expect(page).to_not have_link('Schedules', href: "/admin/conference/#{conference3.short_title}/schedules")
|
||||
expect(page).to_not have_link('Campaigns', href: "/admin/conference/#{conference3.short_title}/campaigns")
|
||||
expect(page).to_not have_link('Targets', href: "/admin/conference/#{conference3.short_title}/targets")
|
||||
expect(page).to_not have_link('Venue', href: "/admin/conference/#{conference3.short_title}/venue")
|
||||
expect(page).to_not have_link('Rooms', href: "/admin/conference/#{conference3.short_title}/venue/rooms")
|
||||
expect(page).to_not have_link('Lodgings', href: "/admin/conference/#{conference3.short_title}/lodgings")
|
||||
expect(page).to_not have_link('Sponsorship', href: "/admin/conference/#{conference3.short_title}/sponsorship_levels")
|
||||
expect(page).to_not have_link('Sponsors', href: "/admin/conference/#{conference3.short_title}/sponsors")
|
||||
expect(page).to_not have_link('Supporter Levels', href: "/admin/conference/#{conference3.short_title}/supporter_levels")
|
||||
expect(page).to_not have_link('E-Mails', href: "/admin/conference/#{conference3.short_title}/emails")
|
||||
expect(page).to_not have_link('Program', href: "/admin/conference/#{conference3.short_title}/program")
|
||||
expect(page).to_not have_link('Call for papers', href: "/admin/conference/#{conference3.short_title}/program/cfp")
|
||||
expect(page).to_not have_link('Tracks', href: "/admin/conference/#{conference3.short_title}/program/tracks")
|
||||
expect(page).to_not have_link('Event types', href: "/admin/conference/#{conference3.short_title}/program/event_types")
|
||||
expect(page).to_not have_link('Difficulty levels', href: "/admin/conference/#{conference3.short_title}/program/difficulty_levels")
|
||||
expect(page).to have_link('Questions', href: "/admin/conference/#{conference3.short_title}/questions")
|
||||
expect(page).to have_link('Roles', href: "/admin/conference/#{conference3.short_title}/roles")
|
||||
expect(page).to_not have_link('Contact', href: "/admin/conferences/#{conference3.short_title}/contact/edit")
|
||||
expect(page).to have_link('Commercials', href: "/admin/conferences/#{conference3.short_title}/commercials")
|
||||
expect(page).to_not have_link('Events', href: "/admin/conferences/#{conference3.short_title}/program/events")
|
||||
expect(page).to have_link('Registrations', href: "/admin/conferences/#{conference3.short_title}/registrations")
|
||||
expect(page).to_not have_link('Schedules', href: "/admin/conferences/#{conference3.short_title}/schedules")
|
||||
expect(page).to_not have_link('Campaigns', href: "/admin/conferences/#{conference3.short_title}/campaigns")
|
||||
expect(page).to_not have_link('Targets', href: "/admin/conferences/#{conference3.short_title}/targets")
|
||||
expect(page).to_not have_link('Venue', href: "/admin/conferences/#{conference3.short_title}/venue")
|
||||
expect(page).to_not have_link('Rooms', href: "/admin/conferences/#{conference3.short_title}/venue/rooms")
|
||||
expect(page).to_not have_link('Lodgings', href: "/admin/conferences/#{conference3.short_title}/lodgings")
|
||||
expect(page).to_not have_link('Sponsorship', href: "/admin/conferences/#{conference3.short_title}/sponsorship_levels")
|
||||
expect(page).to_not have_link('Sponsors', href: "/admin/conferences/#{conference3.short_title}/sponsors")
|
||||
expect(page).to_not have_link('Supporter Levels', href: "/admin/conferences/#{conference3.short_title}/supporter_levels")
|
||||
expect(page).to_not have_link('E-Mails', href: "/admin/conferences/#{conference3.short_title}/emails")
|
||||
expect(page).to_not have_link('Program', href: "/admin/conferences/#{conference3.short_title}/program")
|
||||
expect(page).to_not have_link('Call for papers', href: "/admin/conferences/#{conference3.short_title}/program/cfp")
|
||||
expect(page).to_not have_link('Tracks', href: "/admin/conferences/#{conference3.short_title}/program/tracks")
|
||||
expect(page).to_not have_link('Event types', href: "/admin/conferences/#{conference3.short_title}/program/event_types")
|
||||
expect(page).to_not have_link('Difficulty levels', href: "/admin/conferences/#{conference3.short_title}/program/difficulty_levels")
|
||||
expect(page).to have_link('Questions', href: "/admin/conferences/#{conference3.short_title}/questions")
|
||||
expect(page).to have_link('Roles', href: "/admin/conferences/#{conference3.short_title}/roles")
|
||||
|
||||
visit edit_admin_conference_path(conference3.short_title)
|
||||
expect(current_path).to eq(root_path)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ feature 'BaseController' do
|
|||
describe 'GET #verify_user_admin' do
|
||||
context 'when user is a guest' do
|
||||
it 'redirects to sign in page' do
|
||||
visit admin_conference_index_path
|
||||
visit admin_conferences_path
|
||||
expect(current_path).to eq new_user_session_path
|
||||
end
|
||||
end
|
||||
|
|
@ -23,39 +23,39 @@ feature 'BaseController' do
|
|||
end
|
||||
|
||||
it 'not an admin it redirects to root_path' do
|
||||
visit admin_conference_index_path
|
||||
visit admin_conferences_path
|
||||
expect(current_path).to eq root_path
|
||||
expect(flash).to eq 'You are not authorized to access this area!'
|
||||
end
|
||||
|
||||
it 'an admin he can access the admin area' do
|
||||
user.is_admin = true
|
||||
visit admin_conference_index_path
|
||||
expect(current_path).to eq admin_conference_index_path
|
||||
visit admin_conferences_path
|
||||
expect(current_path).to eq admin_conferences_path
|
||||
end
|
||||
|
||||
it 'an organizer he can access the admin area' do
|
||||
user.role_ids = organizer_role.id
|
||||
visit admin_conference_index_path
|
||||
expect(current_path).to eq admin_conference_index_path
|
||||
visit admin_conferences_path
|
||||
expect(current_path).to eq admin_conferences_path
|
||||
end
|
||||
|
||||
it 'a volunteers_coordinator he can access the admin area' do
|
||||
user.role_ids = volunteers_coordinator_role.id
|
||||
visit admin_conference_index_path
|
||||
expect(current_path).to eq admin_conference_index_path
|
||||
visit admin_conferences_path
|
||||
expect(current_path).to eq admin_conferences_path
|
||||
end
|
||||
|
||||
it 'a cfp he can access the admin area' do
|
||||
user.role_ids = cfp_role.id
|
||||
visit admin_conference_index_path
|
||||
expect(current_path).to eq admin_conference_index_path
|
||||
visit admin_conferences_path
|
||||
expect(current_path).to eq admin_conferences_path
|
||||
end
|
||||
|
||||
it 'an info_desk he can access the admin area' do
|
||||
user.role_ids = info_desk_role.id
|
||||
visit admin_conference_index_path
|
||||
expect(current_path).to eq admin_conference_index_path
|
||||
visit admin_conferences_path
|
||||
expect(current_path).to eq admin_conferences_path
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@ feature Commercial do
|
|||
|
||||
context 'in admin area' do
|
||||
scenario 'adds, updates, deletes of a conference', feature: true, js: true do
|
||||
expected_count = conference.commercials.count + 1
|
||||
|
||||
sign_in organizer
|
||||
|
||||
visit admin_conference_commercials_path(conference.short_title)
|
||||
|
|
@ -22,14 +20,14 @@ feature Commercial do
|
|||
fill_in 'commercial_url', with: 'https://www.youtube.com/watch?v=M9bq_alk-sw'
|
||||
click_button 'Create Commercial'
|
||||
expect(flash).to eq('Commercial was successfully created.')
|
||||
expect(conference.commercials.count).to eq(expected_count)
|
||||
expect(conference.commercials.count).to eq(1)
|
||||
|
||||
commercial = conference.commercials.where(url: 'https://www.youtube.com/watch?v=M9bq_alk-sw').first
|
||||
fill_in "commercial_url_#{commercial.id}", with: 'https://www.youtube.com/watch?v=VNkDJk5_9eU'
|
||||
click_button 'Update'
|
||||
|
||||
expect(flash).to eq('Commercial was successfully updated.')
|
||||
expect(conference.commercials.count).to eq(expected_count)
|
||||
expect(conference.commercials.count).to eq(1)
|
||||
commercial.reload
|
||||
expect(commercial.url).to eq 'https://www.youtube.com/watch?v=VNkDJk5_9eU'
|
||||
|
||||
|
|
@ -37,7 +35,7 @@ feature Commercial do
|
|||
click_link 'Delete'
|
||||
|
||||
expect(flash).to eq('Commercial was successfully destroyed.')
|
||||
expect(conference.commercials.count).to eq(expected_count - 1)
|
||||
expect(conference.commercials.count).to eq(0)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -49,8 +47,6 @@ feature Commercial do
|
|||
user_id: participant.id,
|
||||
event_id: event.id,
|
||||
event_role: 'submitter')]
|
||||
|
||||
@expected_count = Commercial.count + 1
|
||||
sign_in participant
|
||||
end
|
||||
|
||||
|
|
@ -68,7 +64,7 @@ feature Commercial do
|
|||
|
||||
click_button 'Create Commercial'
|
||||
expect(flash).to eq('Commercial was successfully created.')
|
||||
expect(event.commercials.count).to eq(@expected_count)
|
||||
expect(event.commercials.count).to eq(1)
|
||||
end
|
||||
|
||||
scenario 'does not add an invalid commercial of an event', feature: true, js: true do
|
||||
|
|
@ -82,7 +78,7 @@ feature Commercial do
|
|||
click_button 'Create Commercial'
|
||||
expect(flash).to include('An error prohibited this Commercial from being saved:')
|
||||
expect(current_path).to eq edit_conference_program_proposal_path(conference.short_title, event.id)
|
||||
expect(event.commercials.count).to eq 0
|
||||
expect(event.commercials.count).to eq(0)
|
||||
end
|
||||
|
||||
scenario 'updates a commercial of an event', feature: true, versioning: true, js: true do
|
||||
|
|
@ -94,7 +90,7 @@ feature Commercial do
|
|||
fill_in "commercial_url_#{commercial.id}", with: 'https://www.youtube.com/watch?v=M9bq_alk-sw'
|
||||
click_button 'Update'
|
||||
expect(flash).to eq('Commercial was successfully updated.')
|
||||
expect(event.commercials.count).to eq(@expected_count)
|
||||
expect(event.commercials.count).to eq(1)
|
||||
commercial.reload
|
||||
expect(commercial.url).to eq('https://www.youtube.com/watch?v=M9bq_alk-sw')
|
||||
end
|
||||
|
|
@ -122,7 +118,7 @@ feature Commercial do
|
|||
click_link 'Delete'
|
||||
page.driver.network_traffic
|
||||
expect(flash).to eq('Commercial was successfully destroyed.')
|
||||
expect(event.commercials.count).to eq(@expected_count - 1)
|
||||
expect(event.commercials.count).to eq(0)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ feature Event do
|
|||
scenario 'signed_in user submits a valid proposal', feature: true, js: true do
|
||||
sign_in participant_without_bio
|
||||
expected_count = Event.count + 1
|
||||
visit conference_program_proposal_index_path(conference.short_title)
|
||||
visit conference_program_proposals_path(conference.short_title)
|
||||
click_link 'New Proposal'
|
||||
|
||||
fill_in 'event_title', with: 'Example Proposal'
|
||||
|
|
@ -121,13 +121,13 @@ feature Event do
|
|||
click_button 'Create Proposal'
|
||||
expect(flash).to eq('Proposal was successfully submitted.')
|
||||
|
||||
expect(current_path).to eq(conference_program_proposal_index_path(conference.short_title))
|
||||
expect(current_path).to eq(conference_program_proposals_path(conference.short_title))
|
||||
expect(Event.count).to eq(expected_count)
|
||||
end
|
||||
|
||||
scenario 'confirms a proposal', feature: true, js: true do
|
||||
sign_in participant
|
||||
visit conference_program_proposal_index_path(conference.short_title)
|
||||
visit conference_program_proposals_path(conference.short_title)
|
||||
expect(page.has_content?('Example Proposal')).to be true
|
||||
expect(@event.state).to eq('unconfirmed')
|
||||
click_link "confirm_proposal_#{@event.id}"
|
||||
|
|
@ -141,7 +141,7 @@ feature Event do
|
|||
scenario 'withdraw a proposal', feature: true, js: true do
|
||||
sign_in participant
|
||||
@event.confirm!
|
||||
visit conference_program_proposal_index_path(conference.short_title)
|
||||
visit conference_program_proposals_path(conference.short_title)
|
||||
expect(page.has_content?('Example Proposal')).to be true
|
||||
click_link "delete_proposal_#{@event.id}"
|
||||
expect(flash).to eq('Proposal was successfully withdrawn.')
|
||||
|
|
@ -179,14 +179,14 @@ feature 'Version' do
|
|||
click_button 'New'
|
||||
click_link 'Reject event'
|
||||
|
||||
visit conference_program_proposal_index_path(conference_id: conference.short_title)
|
||||
visit conference_program_proposals_path(conference_id: conference.short_title)
|
||||
click_link 'Re-Submit'
|
||||
|
||||
visit admin_conference_program_events_path(conference.short_title)
|
||||
click_button 'New'
|
||||
click_link 'Accept event'
|
||||
|
||||
visit conference_program_proposal_index_path(conference_id: conference.short_title)
|
||||
visit conference_program_proposals_path(conference_id: conference.short_title)
|
||||
click_link 'Confirm'
|
||||
|
||||
visit admin_conference_program_events_path(conference.short_title)
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@ describe EmailSettings do
|
|||
'conference' => conference.title,
|
||||
'conference_start_date' => Date.new(2014, 05, 01),
|
||||
'conference_end_date' => Date.new(2014, 05, 06),
|
||||
'registrationlink' => 'http://localhost:3000/conference/goto/register',
|
||||
'conference_splash_link' => 'http://localhost:3000/conference/goto',
|
||||
'schedule_link' => 'http://localhost:3000/conference/goto/schedule',
|
||||
'registrationlink' => 'http://localhost:3000/conferences/goto/register',
|
||||
'conference_splash_link' => 'http://localhost:3000/conferences/goto',
|
||||
'schedule_link' => 'http://localhost:3000/conferences/goto/schedule',
|
||||
'cfp_end_date' => 'Unknown',
|
||||
'cfp_start_date' => 'Unknown',
|
||||
'venue' => 'Unknown',
|
||||
|
|
@ -87,7 +87,7 @@ describe EmailSettings do
|
|||
|
||||
context 'conference has event' do
|
||||
before do
|
||||
event_hash = { 'eventtitle' => 'Talk about talks', 'proposalslink' => 'http://localhost:3000/conference/goto/program/proposal' }
|
||||
event_hash = { 'eventtitle' => 'Talk about talks', 'proposalslink' => 'http://localhost:3000/conferences/goto/program/proposals' }
|
||||
expected_hash.merge!(event_hash)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@ module Sidebar
|
|||
@conference = create(:conference)
|
||||
assign :conference, @conference
|
||||
render
|
||||
expect(view).to render_template('admin/conference/_sidebar')
|
||||
expect(view).to render_template('admin/conferences/_sidebar')
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'admin/conference/edit' do
|
||||
describe 'admin/conferences/edit' do
|
||||
|
||||
it 'renders conference details which are editable' do
|
||||
@conference = create(:conference, title: 'openSUSE')
|
||||
assign :conference, @conference
|
||||
render template: 'admin/conference/edit.html.haml'
|
||||
render template: 'admin/conferences/edit.html.haml'
|
||||
expect(rendered).to have_selector("input[value='openSUSE']")
|
||||
end
|
||||
end
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'admin/conference/index' do
|
||||
describe 'admin/conferences/index' do
|
||||
let(:conference) { create(:conference, title: 'openSUSE Conference 2016') }
|
||||
let(:second_conference) { create(:conference) }
|
||||
|
||||
it 'renders all conference names with links' do
|
||||
assign(:conferences, [conference, second_conference])
|
||||
render
|
||||
render template: 'admin/conferences/index.html.haml'
|
||||
expect(rendered).to include('openSUSE Conference 2016')
|
||||
expect(rendered).to include(CGI.escapeHTML(second_conference.title))
|
||||
end
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'admin/conference/new' do
|
||||
describe 'admin/conferences/new' do
|
||||
let(:conference) { build(:conference) }
|
||||
|
||||
it 'renders the new template for the conference' do
|
||||
assign(:conference, Conference.new)
|
||||
render
|
||||
render template: 'admin/conferences/new.html.haml'
|
||||
expect(rendered).to include('Basic Information')
|
||||
assign(:conference, conference)
|
||||
render
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'admin/conference/show' do
|
||||
describe 'admin/conferences/show' do
|
||||
|
||||
it 'renders conference dashboard' do
|
||||
conference = create(:conference, title: 'openSUSE')
|
||||
assign :conference, conference
|
||||
assign :program, conference.program
|
||||
assign :conference_progress, conference.get_status
|
||||
render
|
||||
render template: 'admin/conferences/show.html.haml'
|
||||
expect(rendered).to include("Dashboard for #{conference.title}")
|
||||
end
|
||||
end
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'conference/index' do
|
||||
describe 'conferences/index' do
|
||||
it 'renders _conference partial for each conference' do
|
||||
allow(view).to receive(:date_string).and_return('January 17 - 21 2014')
|
||||
assign(:current, [create(:conference), create(:conference)])
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
require 'spec_helper'
|
||||
describe 'conference/show.html.haml' do
|
||||
describe 'conferences/show.html.haml' do
|
||||
let!(:conference) { create(:full_conference) }
|
||||
|
||||
before(:each) do
|
||||
|
|
@ -13,11 +13,11 @@ describe 'conference/show.html.haml' do
|
|||
end
|
||||
|
||||
it 'renders program partial' do
|
||||
expect(view).to render_template(partial: 'conference/_schedule_splashpage')
|
||||
expect(view).to render_template(partial: 'conferences/_schedule_splashpage')
|
||||
end
|
||||
|
||||
it 'renders registration partial' do
|
||||
expect(view).to render_template(partial: 'conference/_registration')
|
||||
expect(view).to render_template(partial: 'conferences/_registration')
|
||||
end
|
||||
|
||||
it 'renders call_for_paper partial' do
|
||||
|
|
@ -25,7 +25,7 @@ describe 'conference/show.html.haml' do
|
|||
end
|
||||
|
||||
it 'renders sponsors partial' do
|
||||
expect(view).to render_template(partial: 'conference/_sponsors')
|
||||
expect(view).to render_template(partial: 'conferences/_sponsors')
|
||||
expect(rendered).to match(conference.contact.email)
|
||||
expect(rendered).to match(conference.sponsors.first.website_url)
|
||||
expect(rendered).to match(CGI.escapeHTML(conference.sponsors.first.description))
|
||||
|
|
@ -33,7 +33,7 @@ describe 'conference/show.html.haml' do
|
|||
end
|
||||
|
||||
it 'renders social media partial' do
|
||||
expect(view).to render_template('conference/_social_media')
|
||||
expect(view).to render_template('conferences/_social_media')
|
||||
expect(rendered).to match(conference.contact.facebook)
|
||||
expect(rendered).to match(conference.contact.googleplus)
|
||||
expect(rendered).to match(conference.contact.instagram)
|
||||
|
|
@ -41,7 +41,7 @@ describe 'conference/show.html.haml' do
|
|||
end
|
||||
|
||||
it 'renders venue partial' do
|
||||
expect(view).to render_template(partial: 'conference/_venue')
|
||||
expect(view).to render_template(partial: 'conferences/_venue')
|
||||
expect(rendered).to match(CGI.escapeHTML(conference.venue.name))
|
||||
expect(rendered).to match(conference.venue.street)
|
||||
expect(rendered).to match(conference.venue.website)
|
||||
|
|
@ -49,7 +49,7 @@ describe 'conference/show.html.haml' do
|
|||
end
|
||||
|
||||
it 'renders lodging partial' do
|
||||
expect(view).to render_template(partial: 'conference/_lodging')
|
||||
expect(view).to render_template(partial: 'conferences/_lodging')
|
||||
expect(rendered).to match(CGI.escapeHTML(conference.lodgings.first.name))
|
||||
expect(rendered).to match(CGI.escapeHTML(conference.lodgings.first.description))
|
||||
# FIXME: Lodging without image doesn't show link
|
||||
Loading…
Add table
Add a link
Reference in a new issue