mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
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,5 +1,5 @@
|
|||
module Admin
|
||||
class ConferenceController < Admin::BaseController
|
||||
class ConferencesController < Admin::BaseController
|
||||
load_and_authorize_resource :conference, find_by: :short_title
|
||||
load_resource :program, through: :conference, singleton: true, except: :index
|
||||
load_resource :user, only: [:remove_user]
|
||||
|
|
@ -30,7 +30,7 @@ class ApplicationController < ActionController::Base
|
|||
(!session[:return_to] ||
|
||||
session[:return_to] &&
|
||||
session[:return_to] == root_path)
|
||||
admin_conference_index_path
|
||||
admin_conferences_path
|
||||
else
|
||||
session[:return_to] || root_path
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
class ConferenceController < ApplicationController
|
||||
class ConferencesController < ApplicationController
|
||||
protect_from_forgery with: :null_session
|
||||
before_filter :respond_to_options
|
||||
before_action :respond_to_options
|
||||
load_and_authorize_resource find_by: :short_title
|
||||
load_resource :program, through: :conference, singleton: true, except: :index
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
class ProposalController < ApplicationController
|
||||
before_filter :authenticate_user!, except: [:show, :new, :create]
|
||||
class ProposalsController < ApplicationController
|
||||
before_action :authenticate_user!, except: [:show, :new, :create]
|
||||
load_resource :conference, find_by: :short_title
|
||||
load_resource :program, through: :conference, singleton: true
|
||||
load_and_authorize_resource :event, parent: false, through: :program
|
||||
|
|
@ -20,7 +20,7 @@ class ProposalController < ApplicationController
|
|||
|
||||
def new
|
||||
@user = User.new
|
||||
@url = conference_program_proposal_index_path(@conference.short_title)
|
||||
@url = conference_program_proposals_path(@conference.short_title)
|
||||
@languages = @program.languages_list
|
||||
end
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ class ProposalController < ApplicationController
|
|||
end
|
||||
|
||||
def create
|
||||
@url = conference_program_proposal_index_path(@conference.short_title)
|
||||
@url = conference_program_proposals_path(@conference.short_title)
|
||||
|
||||
# We allow proposal submission and sign up on same page.
|
||||
# If user is not signed in then first create new user and then sign them in
|
||||
|
|
@ -55,7 +55,7 @@ class ProposalController < ApplicationController
|
|||
event_role: 'speaker')
|
||||
if @event.save
|
||||
ahoy.track 'Event submission', title: 'New submission'
|
||||
redirect_to conference_program_proposal_index_path(@conference.short_title), notice: 'Proposal was successfully submitted.'
|
||||
redirect_to conference_program_proposals_path(@conference.short_title), notice: 'Proposal was successfully submitted.'
|
||||
else
|
||||
flash[:error] = "Could not submit proposal: #{@event.errors.full_messages.join(', ')}"
|
||||
render action: 'new'
|
||||
|
|
@ -66,7 +66,7 @@ class ProposalController < ApplicationController
|
|||
@url = conference_program_proposal_path(@conference.short_title, params[:id])
|
||||
|
||||
if @event.update(event_params)
|
||||
redirect_to conference_program_proposal_index_path(conference_id: @conference.short_title),
|
||||
redirect_to conference_program_proposals_path(conference_id: @conference.short_title),
|
||||
notice: 'Proposal was successfully updated.'
|
||||
else
|
||||
flash[:error] = "Could not update proposal: #{@event.errors.full_messages.join(', ')}"
|
||||
|
|
@ -86,10 +86,10 @@ class ProposalController < ApplicationController
|
|||
end
|
||||
|
||||
if @event.save
|
||||
redirect_to conference_program_proposal_index_path(conference_id: @conference.short_title),
|
||||
redirect_to conference_program_proposals_path(conference_id: @conference.short_title),
|
||||
notice: 'Proposal was successfully withdrawn.'
|
||||
else
|
||||
redirect_to conference_program_proposal_index_path(conference_id: @conference.short_title),
|
||||
redirect_to conference_program_proposals_path(conference_id: @conference.short_title),
|
||||
error: "Could not withdraw proposal: #{@event.errors.full_messages.join(', ')}"
|
||||
end
|
||||
end
|
||||
|
|
@ -107,14 +107,14 @@ class ProposalController < ApplicationController
|
|||
|
||||
if @event.save
|
||||
if @conference.user_registered?(current_user)
|
||||
redirect_to conference_program_proposal_index_path(@conference.short_title),
|
||||
redirect_to conference_program_proposals_path(@conference.short_title),
|
||||
notice: 'The proposal was confirmed.'
|
||||
else
|
||||
redirect_to new_conference_conference_registration_path(conference_id: @conference.short_title),
|
||||
alert: 'The proposal was confirmed. Please register to attend the conference.'
|
||||
end
|
||||
else
|
||||
redirect_to conference_program_proposal_index_path(conference_id: @conference.short_title),
|
||||
redirect_to conference_program_proposals_path(conference_id: @conference.short_title),
|
||||
error: "Could not confirm proposal: #{@event.errors.full_messages.join(', ')}"
|
||||
end
|
||||
end
|
||||
|
|
@ -126,16 +126,16 @@ class ProposalController < ApplicationController
|
|||
begin
|
||||
@event.restart
|
||||
rescue Transitions::InvalidTransition
|
||||
redirect_to conference_program_proposal_index_path(conference_id: @conference.short_title),
|
||||
redirect_to conference_program_proposals_path(conference_id: @conference.short_title),
|
||||
error: "The proposal can't be re-submitted."
|
||||
return
|
||||
end
|
||||
|
||||
if @event.save
|
||||
redirect_to conference_program_proposal_index_path(conference_id: @conference.short_title),
|
||||
redirect_to conference_program_proposals_path(conference_id: @conference.short_title),
|
||||
notice: "The proposal was re-submitted. The #{@conference.short_title} organizers will review it again."
|
||||
else
|
||||
redirect_to conference_program_proposal_index_path(conference_id: @conference.short_title),
|
||||
redirect_to conference_program_proposals_path(conference_id: @conference.short_title),
|
||||
error: "Could not re-submit proposal: #{@event.errors.full_messages.join(', ')}"
|
||||
end
|
||||
end
|
||||
|
|
@ -38,12 +38,12 @@ module ApplicationHelper
|
|||
"Registered: #{event.registrations.count}"
|
||||
end
|
||||
|
||||
# Set resource_name for devise so that we can call the devise help links (views/devise/shared/_links) from anywhere (eg sign_up form in proposal#new)
|
||||
# Set resource_name for devise so that we can call the devise help links (views/devise/shared/_links) from anywhere (eg sign_up form in proposals#new)
|
||||
def resource_name
|
||||
:user
|
||||
end
|
||||
|
||||
# Set devise_mapping for devise so that we can call the devise help links (views/devise/shared/_links) from anywhere (eg sign_up form in proposal#new)
|
||||
# Set devise_mapping for devise so that we can call the devise help links (views/devise/shared/_links) from anywhere (eg sign_up form in proposals#new)
|
||||
def devise_mapping
|
||||
@devise_mapping ||= Devise.mappings[:user]
|
||||
end
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class EmailSettings < ActiveRecord::Base
|
|||
|
||||
if event
|
||||
h['eventtitle'] = event.title
|
||||
h['proposalslink'] = Rails.application.routes.url_helpers.conference_program_proposal_index_url(
|
||||
h['proposalslink'] = Rails.application.routes.url_helpers.conference_program_proposals_url(
|
||||
conference.short_title, host: (ENV['OSEM_HOSTNAME'] || 'localhost:3000'))
|
||||
end
|
||||
h
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
.row
|
||||
.col-md-8
|
||||
= semantic_form_for(@conference, :url => admin_conference_index_path) do |f|
|
||||
= semantic_form_for(@conference, :url => admin_conferences_path) do |f|
|
||||
= f.inputs 'Basic Information' do
|
||||
= f.input :title, hint: "The name of your conference as it shall appear throughout the site. Example: 'OpenSUSE Conference 2013'",
|
||||
input_html: { required: 'required' }
|
||||
|
|
@ -35,7 +35,7 @@
|
|||
%b Highlight
|
||||
%td
|
||||
= check_box_tag @conference.short_title, @event.id, @event.is_highlight,
|
||||
method: :patch, url: "/admin/conference/#{@conference.short_title}/program/events/#{@event.id}?event[is_highlight]=",
|
||||
method: :patch, url: "/admin/conferences/#{@conference.short_title}/program/events/#{@event.id}?event[is_highlight]=",
|
||||
class: 'switch-checkbox', data: { size: 'small',
|
||||
off_color: 'warning',
|
||||
on_text: 'Yes',
|
||||
|
|
@ -91,7 +91,7 @@
|
|||
%b Requires Registration
|
||||
%td
|
||||
= check_box_tag @conference.short_title, @event.id, @event.require_registration,
|
||||
method: :patch, url: "/admin/conference/#{@conference.short_title}/program/events/#{@event.id}?event[require_registration]=",
|
||||
method: :patch, url: "/admin/conferences/#{@conference.short_title}/program/events/#{@event.id}?event[require_registration]=",
|
||||
class: 'switch-checkbox', data: { size: 'small',
|
||||
off_color: 'warning',
|
||||
on_text: 'Yes',
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
= render 'proposal/form'
|
||||
= render 'proposals/form'
|
||||
|
|
@ -9,11 +9,11 @@
|
|||
All the submissions of your speakers
|
||||
.row
|
||||
.col-md-4
|
||||
= render partial: 'admin/conference/doughnut_chart', locals: {title: 'Events state', data: @event_distribution}
|
||||
= render partial: 'admin/conferences/doughnut_chart', locals: {title: 'Events state', data: @event_distribution}
|
||||
.col-md-4
|
||||
= render partial: 'admin/conference/doughnut_chart', locals: {title: 'Confirmed events scheduled', data: @scheduled_event_distribution}
|
||||
= render partial: 'admin/conferences/doughnut_chart', locals: {title: 'Confirmed events scheduled', data: @scheduled_event_distribution}
|
||||
.col-md-4
|
||||
= render partial: 'admin/conference/doughnut_chart', locals: {title: 'Tracks of confirmed events', data: @tracks_distribution_confirmed}
|
||||
= render partial: 'admin/conferences/doughnut_chart', locals: {title: 'Tracks of confirmed events', data: @tracks_distribution_confirmed}
|
||||
.row
|
||||
.col-md-12
|
||||
%div.margin-event-table
|
||||
|
|
@ -85,7 +85,7 @@
|
|||
|
||||
%td.text-center{'data-order' => "#{event.require_registration}"}
|
||||
= check_box_tag @conference.short_title, event.id, event.require_registration,
|
||||
method: :patch, url: "/admin/conference/#{@conference.short_title}/program/events/#{event.id}?event[require_registration]=",
|
||||
method: :patch, url: "/admin/conferences/#{@conference.short_title}/program/events/#{event.id}?event[require_registration]=",
|
||||
class: 'switch-checkbox', data: { size: 'small',
|
||||
off_color: 'warning',
|
||||
on_text: 'Yes',
|
||||
|
|
@ -96,7 +96,7 @@
|
|||
|
||||
%td.text-center{'data-order' => "#{event.is_highlight}"}
|
||||
= check_box_tag @conference.short_title, event.id, event.is_highlight,
|
||||
method: :patch, url: "/admin/conference/#{@conference.short_title}/program/events/#{event.id}?event[is_highlight]=",
|
||||
method: :patch, url: "/admin/conferences/#{@conference.short_title}/program/events/#{event.id}?event[is_highlight]=",
|
||||
class: 'switch-checkbox', data: { size: 'small',
|
||||
off_color: 'warning',
|
||||
on_text: 'Yes',
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
%td= event_registration.email
|
||||
%td= event_registration.created_at
|
||||
%td
|
||||
= check_box_tag @conference.short_title, @event.id, event_registration.attended, class: 'switch-checkbox', method: :patch, url: "/admin/conference/#{@conference.short_title}/program/events/#{@event.id}/toggle_attendance?events_registration_id=#{event_registration.id}&&event_registration[attended]=",
|
||||
= check_box_tag @conference.short_title, @event.id, event_registration.attended, class: 'switch-checkbox', method: :patch, url: "/admin/conferences/#{@conference.short_title}/program/events/#{@event.id}/toggle_attendance?events_registration_id=#{event_registration.id}&&event_registration[attended]=",
|
||||
data: { size: 'small',
|
||||
off_color: 'danger',
|
||||
on_text: 'Yes',
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@
|
|||
%p.text-muted
|
||||
All the people who registered to your event
|
||||
.col-md-4
|
||||
= render partial: 'admin/conference/doughnut_chart', locals: {title: 'Affiliation', data: @affiliation_distribution}
|
||||
= render partial: 'admin/conferences/doughnut_chart', locals: {title: 'Affiliation', data: @affiliation_distribution}
|
||||
- unless @conference.pending?
|
||||
.col-md-4
|
||||
= render partial: 'admin/conference/doughnut_chart', locals: {title: 'Attended registrations', data: @registration_distribution}
|
||||
= render partial: 'admin/conferences/doughnut_chart', locals: {title: 'Attended registrations', data: @registration_distribution}
|
||||
.row
|
||||
.col-md-12
|
||||
%div.margin-event-table
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
- if ( can? :toggle_user, @role )
|
||||
%td.text-right
|
||||
= hidden_field_tag "role[user_ids][]", nil
|
||||
= check_box_tag @conference.short_title, @role.id, (@role.user_ids.include? user.id), method: :post, url: "/admin/conference/#{@conference.short_title}/roles/#{@role.name}/toggle_user?user[email]=#{user.email}&user[state]=", class: 'switch-checkbox', data: { size: 'small', off_color: 'warning', on_text: 'Yes', off_text: 'No' }
|
||||
= check_box_tag @conference.short_title, @role.id, (@role.user_ids.include? user.id), method: :post, url: "/admin/conferences/#{@conference.short_title}/roles/#{@role.name}/toggle_user?user[email]=#{user.email}&user[state]=", class: 'switch-checkbox', data: { size: 'small', off_color: 'warning', on_text: 'Yes', off_text: 'No' }
|
||||
%td= user.id
|
||||
%td= user.name
|
||||
%td= user.email
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
.row
|
||||
.col-md-6
|
||||
- if @conference.venue.location?
|
||||
= render 'conference/venue_map'
|
||||
= render '/conferences/venue_map'
|
||||
-else
|
||||
- if @venue.commercial.nil?
|
||||
.row
|
||||
|
|
|
|||
|
|
@ -40,4 +40,4 @@
|
|||
.row
|
||||
.col-md-12.text-center
|
||||
%p.cta-button
|
||||
= link_to "Submit your paper now", conference_program_proposal_index_path(@conference.short_title), class: 'btn btn-success btn-lg text-center'
|
||||
= link_to "Submit your paper now", conference_program_proposals_path(@conference.short_title), class: 'btn btn-success btn-lg text-center'
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
- if conference.registration_limit_exceeded?
|
||||
Sorry, no places left
|
||||
- if !current_user.nil? && current_user.proposal_count(conference) > 0
|
||||
= link_to "My Proposals", conference_program_proposal_index_path(conference.short_title), :class =>"btn btn-default"
|
||||
= link_to "My Proposals", conference_program_proposals_path(conference.short_title), :class =>"btn btn-default"
|
||||
- elsif can? :new, conference.program.events.new
|
||||
= link_to "Submit Proposal", new_conference_program_proposal_path(conference.short_title), :class =>"btn btn-default"
|
||||
- if current_user.nil? || !current_user.subscribed?(conference)
|
||||
|
|
@ -37,4 +37,4 @@
|
|||
.row
|
||||
.col-md-12.text-center
|
||||
%p.cta-button
|
||||
= link_to "Submit your paper now", conference_proposal_index_path(@conference.short_title), class: 'btn btn-success btn-lg text-center'
|
||||
= link_to "Submit your paper now", conference_proposals_path(@conference.short_title), class: 'btn btn-success btn-lg text-center'
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
%li
|
||||
%a.smoothscroll{ href: '#venue' } Venue
|
||||
-if @conference.venue.location?
|
||||
= render 'conference/venue_map'
|
||||
= render '/conferences/venue_map'
|
||||
-else
|
||||
.container
|
||||
.row
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
%span.caret
|
||||
%ul.dropdown-menu{role:'menu'}
|
||||
%li
|
||||
= link_to(admin_conference_index_path) do
|
||||
= link_to(admin_conferences_path) do
|
||||
%span.fa.fa-home
|
||||
All Conferences
|
||||
- @conferences.each do |conference|
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
%span.caret
|
||||
%ul.dropdown-menu{role: 'menu'}
|
||||
%li
|
||||
= link_to(admin_conference_index_path) do
|
||||
= link_to(admin_conferences_path) do
|
||||
%span.fa.fa-home
|
||||
All Conferences
|
||||
- @conferences.each do |conference|
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
Edit Profile
|
||||
-if @conference and @conference.program
|
||||
%li
|
||||
= link_to(conference_program_proposal_index_path(@conference.short_title)) do
|
||||
= link_to(conference_program_proposals_path(@conference.short_title)) do
|
||||
%span.fa.fa-comment
|
||||
My Submissions
|
||||
%li
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
%li.divider
|
||||
%li
|
||||
- if Conference.any?
|
||||
= link_to(admin_conference_index_path()) do
|
||||
= link_to(admin_conferences_path()) do
|
||||
%span.fa.fa-home
|
||||
Administration
|
||||
- if can? :create, Conference
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
= link_to 'Commercials', '#commercials-content', 'data-toggle' => 'tab'
|
||||
.tab-content
|
||||
#proposal-content.tab-pane.active
|
||||
= render 'proposal/proposal_form'
|
||||
= render 'proposals/proposal_form'
|
||||
#commercials-content.tab-pane
|
||||
%p.text-muted
|
||||
You can add commercials for your proposal. These commercials will be displayed on the
|
||||
|
|
@ -25,7 +25,7 @@ Osem::Application.routes.draw do
|
|||
end
|
||||
end
|
||||
resources :comments, only: [:index]
|
||||
resources :conference do
|
||||
resources :conferences do
|
||||
resource :contact, except: [:index, :new, :create, :show, :destroy]
|
||||
resources :schedules, only: [:index, :create, :show, :update, :destroy]
|
||||
resources :event_schedules, only: [:create, :update, :destroy]
|
||||
|
|
@ -102,17 +102,17 @@ Osem::Application.routes.draw do
|
|||
get '/revision_history/:id/revert_attribute' => 'versions#revert_attribute', as: 'revision_history_revert_attribute'
|
||||
end
|
||||
|
||||
resources :conference, only: [:index, :show] do
|
||||
resources :conferences, only: [:index, :show] do
|
||||
resource :program, only: [] do
|
||||
resources :proposal, except: :destroy do
|
||||
resources :proposals, except: :destroy do
|
||||
get 'commercials/render_commercial' => 'commercials#render_commercial'
|
||||
resources :commercials, only: [:create, :update, :destroy]
|
||||
member do
|
||||
get :registrations
|
||||
patch '/withdraw' => 'proposal#withdraw'
|
||||
patch '/withdraw' => 'proposals#withdraw'
|
||||
get :registrations
|
||||
patch '/confirm' => 'proposal#confirm'
|
||||
patch '/restart' => 'proposal#restart'
|
||||
patch '/confirm' => 'proposals#confirm'
|
||||
patch '/restart' => 'proposals#restart'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -145,7 +145,7 @@ Osem::Application.routes.draw do
|
|||
end
|
||||
end
|
||||
|
||||
get '/admin' => redirect('/admin/conference')
|
||||
get '/admin' => redirect('/admin/conferences')
|
||||
|
||||
root to: 'conference#index', via: [:get, :options]
|
||||
root to: 'conferences#index', via: [:get, :options]
|
||||
end
|
||||
|
|
|
|||
|
|
@ -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