Merge pull request #630 from hennevogel/master
Last stage of refactoring of the ability model and spec
This commit is contained in:
commit
333c5e39bf
23 changed files with 410 additions and 160 deletions
|
|
@ -16,7 +16,7 @@ module Admin
|
||||||
|
|
||||||
if @venue.save
|
if @venue.save
|
||||||
redirect_to admin_conference_venue_path,
|
redirect_to admin_conference_venue_path,
|
||||||
notice: 'Venue successfully created.'
|
notice: 'Venue was successfully created.'
|
||||||
else
|
else
|
||||||
render :new
|
render :new
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -143,3 +143,5 @@ class ProposalController < ApplicationController
|
||||||
notice: "The proposal was re-submitted. The #{@conference.short_title} organizers will review it again.")
|
notice: "The proposal was re-submitted. The #{@conference.short_title} organizers will review it again.")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# FIXME: Introduce strong_parameters pronto!
|
||||||
|
|
|
||||||
|
|
@ -83,62 +83,95 @@ class Ability
|
||||||
# Abilities from not_signed_in and signed_in are also inherited
|
# Abilities from not_signed_in and signed_in are also inherited
|
||||||
signed_in(user)
|
signed_in(user)
|
||||||
|
|
||||||
conf_ids_for_organizer = []
|
signed_in_with_organizer_role(user)
|
||||||
conf_ids_for_cfp = []
|
signed_in_with_cfp_role(user)
|
||||||
conf_ids_for_info_desk = []
|
signed_in_with_info_desk_role(user)
|
||||||
conf_ids_for_volunteer_coordinator = []
|
signed_in_with_volunteers_coordinator_role(user)
|
||||||
|
|
||||||
# Ids of all the conferences for which the user has an 'organizer' role
|
# for users with any role
|
||||||
|
can [:show], Conference
|
||||||
|
can :index, Commercial, commercialable_type: 'Conference'
|
||||||
|
cannot [:edit, :update, :destroy], Question, global: true
|
||||||
|
# for admins
|
||||||
|
can :manage, :all if user.is_admin
|
||||||
|
end
|
||||||
|
|
||||||
|
def signed_in_with_organizer_role(user)
|
||||||
|
# ids of all the conferences for which the user has the 'organizer' role
|
||||||
|
conf_ids_for_organizer = []
|
||||||
conf_ids_for_organizer =
|
conf_ids_for_organizer =
|
||||||
Conference.with_role(:organizer, user).pluck(:id) if user.has_role? :organizer, :any
|
Conference.with_role(:organizer, user).pluck(:id) if user.has_role? :organizer, :any
|
||||||
conf_ids_for_cfp =
|
|
||||||
Conference.with_role(:cfp, user).pluck(:id) if user.has_role? :cfp, :any
|
|
||||||
# Ids of all the conferences for which the user has an 'info_desk' role
|
|
||||||
conf_ids_for_info_desk =
|
|
||||||
Conference.with_role(:info_desk, user).pluck(:id) if user.has_role? :info_desk, :any
|
|
||||||
# Ids of all the conferences for which the user has a 'volunteer_coordinator' role
|
|
||||||
conf_ids_for_volunteer_coordinator =
|
|
||||||
Conference.with_role(:volunteer_coordinator, user).pluck(:id) if user.has_role? :volunteer_coordinator, :any
|
|
||||||
|
|
||||||
# User with role
|
can [:new, :create], Conference if user.has_role?(:organizer, :any)
|
||||||
can [:new, :create], Conference if user.is_admin || (user.has_role? :organizer, :any)
|
|
||||||
can [:index, :show, :gallery_photos], Conference
|
|
||||||
can :manage, Conference, id: conf_ids_for_organizer
|
can :manage, Conference, id: conf_ids_for_organizer
|
||||||
# can :manage, Conference do |conference|
|
can :manage, Splashpage, conference_id: conf_ids_for_organizer
|
||||||
# conference.id = conf_ids_for_organizer
|
can :manage, Contact, conference_id: conf_ids_for_organizer
|
||||||
# end
|
can :manage, EmailSettings, conference_id: conf_ids_for_organizer
|
||||||
can :manage, Registration, conference_id: conf_ids_for_organizer + conf_ids_for_info_desk
|
|
||||||
can :manage, Question, conference_id: conf_ids_for_organizer + conf_ids_for_info_desk
|
|
||||||
cannot [:edit, :update, :destroy], Question, global: true
|
|
||||||
can :manage, Vposition, conference_id: conf_ids_for_organizer + conf_ids_for_volunteer_coordinator
|
|
||||||
can :manage, Vday, conference_id: conf_ids_for_organizer + conf_ids_for_volunteer_coordinator
|
|
||||||
# The ability to manage an Event means that:
|
|
||||||
# the user can also edit the schedule and that
|
|
||||||
# the user can also vote
|
|
||||||
can :manage, Event, conference_id: conf_ids_for_organizer + conf_ids_for_cfp
|
|
||||||
can :create, Event
|
|
||||||
can :manage, EventType, conference_id: conf_ids_for_organizer + conf_ids_for_cfp
|
|
||||||
can :manage, Track, conference_id: conf_ids_for_organizer + conf_ids_for_cfp
|
|
||||||
can :manage, DifficultyLevel, conference_id: conf_ids_for_organizer + conf_ids_for_cfp
|
|
||||||
can :manage, EmailSettings, conference_id: conf_ids_for_organizer + conf_ids_for_cfp
|
|
||||||
can :manage, Campaign, conference_id: conf_ids_for_organizer
|
can :manage, Campaign, conference_id: conf_ids_for_organizer
|
||||||
|
can :manage, Target, conference_id: conf_ids_for_organizer
|
||||||
|
can :manage, Commercial, commercialable_type: 'Conference',
|
||||||
|
commercialable_id: conf_ids_for_organizer
|
||||||
|
can :manage, Registration, conference_id: conf_ids_for_organizer
|
||||||
|
can :manage, RegistrationPeriod, conference_id: conf_ids_for_organizer
|
||||||
|
can :manage, Question, conference_id: conf_ids_for_organizer
|
||||||
|
can :manage, Question do |question|
|
||||||
|
!(question.conferences.pluck(:id) & conf_ids_for_organizer).empty?
|
||||||
|
end
|
||||||
|
can :manage, Vposition, conference_id: conf_ids_for_organizer
|
||||||
|
can :manage, Vday, conference_id: conf_ids_for_organizer
|
||||||
|
can :manage, CallForPaper, conference_id: conf_ids_for_organizer
|
||||||
|
can :manage, Event, conference_id: conf_ids_for_organizer
|
||||||
|
can :manage, EventType, conference_id: conf_ids_for_organizer
|
||||||
|
can :manage, Track, conference_id: conf_ids_for_organizer
|
||||||
|
can :manage, DifficultyLevel, conference_id: conf_ids_for_organizer
|
||||||
|
can :manage, Commercial, commercialable_type: 'Event',
|
||||||
|
commercialable_id: Event.where(conference_id: conf_ids_for_organizer).pluck(:id)
|
||||||
|
can :manage, Venue, conference_id: conf_ids_for_organizer
|
||||||
can :manage, Lodging, conference_id: conf_ids_for_organizer
|
can :manage, Lodging, conference_id: conf_ids_for_organizer
|
||||||
can :manage, Room, conference_id: conf_ids_for_organizer + conf_ids_for_cfp
|
can :manage, Room, conference_id: conf_ids_for_organizer
|
||||||
can :manage, Sponsor, conference_id: conf_ids_for_organizer
|
can :manage, Sponsor, conference_id: conf_ids_for_organizer
|
||||||
can :manage, SponsorshipLevel, conference_id: conf_ids_for_organizer
|
can :manage, SponsorshipLevel, conference_id: conf_ids_for_organizer
|
||||||
can :manage, Ticket, conference_id: conf_ids_for_organizer
|
can :manage, Ticket, conference_id: conf_ids_for_organizer
|
||||||
can :manage, Target, conference_id: conf_ids_for_organizer
|
end
|
||||||
can :index, Commercial, commercialable_type: 'Conference'
|
|
||||||
can :manage, Commercial, commercialable_type: 'Conference', commercialable_id: conf_ids_for_organizer
|
def signed_in_with_cfp_role(user)
|
||||||
# Manage commercials for events that belong to a conference of which user is organizer
|
# ids of all the conferences for which the user has the 'cfp' role
|
||||||
can :manage, Commercial, commercialable_type: 'Event', commercialable_id: Event.where(conference_id: conf_ids_for_organizer + conf_ids_for_cfp).pluck(:id)
|
conf_ids_for_cfp = []
|
||||||
can :manage, Contact, conference_id: conf_ids_for_organizer
|
conf_ids_for_cfp =
|
||||||
can :manage, Campaign, conference_id: conf_ids_for_organizer
|
Conference.with_role(:cfp, user).pluck(:id) if user.has_role? :cfp, :any
|
||||||
can :manage, RegistrationPeriod, conference_id: conf_ids_for_organizer
|
|
||||||
can :manage, Splashpage, conference_id: conf_ids_for_organizer
|
can :manage, Event, conference_id: conf_ids_for_cfp
|
||||||
can :manage, CallForPaper, conference_id: conf_ids_for_organizer + conf_ids_for_cfp
|
can :manage, EventType, conference_id: conf_ids_for_cfp
|
||||||
can :manage, Venue, conference_id: conf_ids_for_organizer
|
can :manage, Track, conference_id: conf_ids_for_cfp
|
||||||
can :index, Venue, conference_id: conf_ids_for_organizer + conf_ids_for_cfp
|
can :manage, DifficultyLevel, conference_id: conf_ids_for_cfp
|
||||||
can :manage, :all if user.is_admin
|
can :manage, EmailSettings, conference_id: conf_ids_for_cfp
|
||||||
|
can :manage, Room, conference_id: conf_ids_for_cfp
|
||||||
|
can :index, Venue, conference_id: conf_ids_for_cfp
|
||||||
|
can :manage, CallForPaper, conference_id: conf_ids_for_cfp
|
||||||
|
can :manage, Commercial, commercialable_type: 'Event',
|
||||||
|
commercialable_id: Event.where(conference_id: conf_ids_for_cfp).pluck(:id)
|
||||||
|
end
|
||||||
|
|
||||||
|
def signed_in_with_info_desk_role(user)
|
||||||
|
# ids of all the conferences for which the user has the 'info_desk' role
|
||||||
|
conf_ids_for_info_desk = []
|
||||||
|
conf_ids_for_info_desk =
|
||||||
|
Conference.with_role(:info_desk, user).pluck(:id) if user.has_role? :info_desk, :any
|
||||||
|
|
||||||
|
can :manage, Registration, conference_id: conf_ids_for_info_desk
|
||||||
|
can :manage, Question, conference_id: conf_ids_for_info_desk
|
||||||
|
can :manage, Question do |question|
|
||||||
|
!(question.conferences.pluck(:id) & conf_ids_for_info_desk).empty?
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def signed_in_with_volunteers_coordinator_role(user)
|
||||||
|
# ids of all the conferences for which the user has the 'volunteers_coordinator' role
|
||||||
|
conf_ids_for_volunteers_coordinator = []
|
||||||
|
conf_ids_for_volunteers_coordinator =
|
||||||
|
Conference.with_role(:volunteer_coordinator, user).pluck(:id) if user.has_role? :volunteer_coordinator, :any
|
||||||
|
|
||||||
|
can :manage, Vposition, conference_id: conf_ids_for_volunteers_coordinator
|
||||||
|
can :manage, Vday, conference_id: conf_ids_for_volunteers_coordinator
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
%span.fa.fa-cog
|
%span.fa.fa-cog
|
||||||
Manage
|
Manage
|
||||||
= @conference.short_title
|
= @conference.short_title
|
||||||
- if can? :index, User
|
- if can? :manage, User.new
|
||||||
%li
|
%li
|
||||||
= link_to(admin_users_path) do
|
= link_to(admin_users_path) do
|
||||||
%span.fa.fa-user
|
%span.fa.fa-user
|
||||||
|
|
|
||||||
7
spec/factories/answer.rb
Normal file
7
spec/factories/answer.rb
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
# Read about factories at https://github.com/thoughtbot/factory_girl
|
||||||
|
|
||||||
|
FactoryGirl.define do
|
||||||
|
factory :answer do
|
||||||
|
title 'Do you?'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -4,5 +4,6 @@ FactoryGirl.define do
|
||||||
factory :campaign do
|
factory :campaign do
|
||||||
name 'Test Campaign'
|
name 'Test Campaign'
|
||||||
utm_campaign 'testcampaign'
|
utm_campaign 'testcampaign'
|
||||||
|
conference
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -4,5 +4,13 @@ FactoryGirl.define do
|
||||||
factory :commercial do
|
factory :commercial do
|
||||||
commercial_type 'YouTube'
|
commercial_type 'YouTube'
|
||||||
commercial_id 'test'
|
commercial_id 'test'
|
||||||
|
|
||||||
|
factory :conference_commercial do
|
||||||
|
association :commercialable, factory: :conference
|
||||||
|
end
|
||||||
|
|
||||||
|
factory :event_commercial do
|
||||||
|
association :commercialable, factory: :event
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,22 @@ FactoryGirl.define do
|
||||||
timezone 'Amsterdam'
|
timezone 'Amsterdam'
|
||||||
start_date { Date.today }
|
start_date { Date.today }
|
||||||
end_date { 6.days.from_now }
|
end_date { 6.days.from_now }
|
||||||
venue
|
factory :full_conference do
|
||||||
|
venue
|
||||||
|
splashpage
|
||||||
|
registration_period
|
||||||
|
call_for_paper
|
||||||
|
|
||||||
|
after(:build) do |conference|
|
||||||
|
conference.commercials << build(:conference_commercial, commercialable: conference)
|
||||||
|
conference.campaigns << build(:campaign, conference: conference)
|
||||||
|
conference.targets << build(:target, conference: conference)
|
||||||
|
conference.questions << build(:question, conference_id: conference.id)
|
||||||
|
conference.lodgings << build(:lodging, conference: conference)
|
||||||
|
conference.sponsors << build(:sponsor, conference: conference)
|
||||||
|
conference.sponsorship_levels << build(:sponsorship_level, conference: conference)
|
||||||
|
conference.tickets << build(:ticket, conference: conference)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,7 @@
|
||||||
FactoryGirl.define do
|
FactoryGirl.define do
|
||||||
factory :event do
|
factory :event do
|
||||||
sequence(:title) { |n| "The ##{n} talk you'll ever attend." }
|
sequence(:title) { |n| "The ##{n} talk you'll ever attend." }
|
||||||
event_type
|
|
||||||
conference
|
conference
|
||||||
association :room, factory: :room_for_100
|
|
||||||
abstract <<-EOS
|
abstract <<-EOS
|
||||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ante
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ante
|
||||||
lacus, mollis non urna vitae, varius semper leo. Nulla ac nibh dui. Mauris
|
lacus, mollis non urna vitae, varius semper leo. Nulla ac nibh dui. Mauris
|
||||||
|
|
@ -33,7 +31,24 @@ FactoryGirl.define do
|
||||||
libero quis porta ultricies. Fusce pulvinar accumsan lobortis.
|
libero quis porta ultricies. Fusce pulvinar accumsan lobortis.
|
||||||
EOS
|
EOS
|
||||||
after(:build) do |event|
|
after(:build) do |event|
|
||||||
event.event_users << build(:submitter, event: event)
|
event.event_users << build(:submitter)
|
||||||
|
# set an event_type if none is passed to the factory.
|
||||||
|
# needs to be created here because otherwise it doesn't belong to the
|
||||||
|
# same conference as the event
|
||||||
|
event.event_type ||= build(:event_type, conference: event.conference)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
factory :event_full do
|
||||||
|
difficulty_level
|
||||||
|
track
|
||||||
|
room
|
||||||
|
after(:build) do |event|
|
||||||
|
event.commercials << build(:event_commercial, commercialable: event)
|
||||||
|
event.difficulty_level = build(:difficulty_level, conference: event.conference)
|
||||||
|
event.track = build(:track, conference: event.conference)
|
||||||
|
event.room = build(:room, conference: event.conference)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -5,5 +5,6 @@ FactoryGirl.define do
|
||||||
name 'Example Hotel'
|
name 'Example Hotel'
|
||||||
description 'Lorem Ipsum Dolor'
|
description 'Lorem Ipsum Dolor'
|
||||||
website_link 'http://www.example.com'
|
website_link 'http://www.example.com'
|
||||||
|
conference
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
8
spec/factories/qanswer.rb
Normal file
8
spec/factories/qanswer.rb
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
# Read about factories at https://github.com/thoughtbot/factory_girl
|
||||||
|
|
||||||
|
FactoryGirl.define do
|
||||||
|
factory :qanswer do
|
||||||
|
question
|
||||||
|
answer
|
||||||
|
end
|
||||||
|
end
|
||||||
12
spec/factories/question.rb
Normal file
12
spec/factories/question.rb
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
# Read about factories at https://github.com/thoughtbot/factory_girl
|
||||||
|
|
||||||
|
FactoryGirl.define do
|
||||||
|
factory :question do
|
||||||
|
title 'blah'
|
||||||
|
question_type
|
||||||
|
after(:build) do |question|
|
||||||
|
question.answers << build(:answer)
|
||||||
|
question.conferences << build(:conference)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
7
spec/factories/question_type.rb
Normal file
7
spec/factories/question_type.rb
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
# Read about factories at https://github.com/thoughtbot/factory_girl
|
||||||
|
|
||||||
|
FactoryGirl.define do
|
||||||
|
factory :question_type do
|
||||||
|
title 'Multiple Choice'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -4,5 +4,6 @@ FactoryGirl.define do
|
||||||
factory :registration_period do
|
factory :registration_period do
|
||||||
start_date { 3.days.from_now }
|
start_date { 3.days.from_now }
|
||||||
end_date { 5.days.from_now }
|
end_date { 5.days.from_now }
|
||||||
|
conference
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -8,5 +8,13 @@ FactoryGirl.define do
|
||||||
factory :cfp_role do
|
factory :cfp_role do
|
||||||
name 'cfp'
|
name 'cfp'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
factory :info_desk_role do
|
||||||
|
name 'info_desk'
|
||||||
|
end
|
||||||
|
|
||||||
|
factory :volunteers_coordinator_role do
|
||||||
|
name 'volunteers_coordinator'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,6 @@
|
||||||
|
|
||||||
FactoryGirl.define do
|
FactoryGirl.define do
|
||||||
factory :splashpage do
|
factory :splashpage do
|
||||||
public true
|
public false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -5,5 +5,6 @@ FactoryGirl.define do
|
||||||
due_date { 14.days.from_now }
|
due_date { 14.days.from_now }
|
||||||
target_count 100
|
target_count 100
|
||||||
unit Target.units[:submissions]
|
unit Target.units[:submissions]
|
||||||
|
conference
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -3,5 +3,6 @@ FactoryGirl.define do
|
||||||
title 'Business Ticket'
|
title 'Business Ticket'
|
||||||
price_cents 1000
|
price_cents 1000
|
||||||
price_currency 'USD'
|
price_currency 'USD'
|
||||||
|
conference
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,11 @@ require 'spec_helper'
|
||||||
|
|
||||||
feature 'Has correct abilities' do
|
feature 'Has correct abilities' do
|
||||||
# It is necessary to use bang version of let to build roles before user
|
# It is necessary to use bang version of let to build roles before user
|
||||||
let(:conference1) { create(:conference) } # user is organizer
|
let(:conference1) { create(:conference, venue: create(:venue)) } # user is organizer
|
||||||
let(:conference2) { create(:conference) } # user is cfp
|
let(:conference2) { create(:conference, venue: create(:venue)) } # user is cfp
|
||||||
let(:conference3) { create(:conference) } # user is info_desk
|
let(:conference3) { create(:conference, venue: create(:venue)) } # user is info_desk
|
||||||
let(:conference4) { create(:conference) } # user is volunteer coordinator
|
let(:conference4) { create(:conference, venue: create(:venue)) } # user is volunteer coordinator
|
||||||
let(:conference5) { create(:conference) } # user has no role
|
let(:conference5) { create(:conference, venue: create(:venue)) } # user has no role
|
||||||
|
|
||||||
let(:role_organizer) { create(:role, name: 'organizer', resource: conference1) }
|
let(:role_organizer) { create(:role, name: 'organizer', resource: conference1) }
|
||||||
let(:role_cfp) { create(:role, name: 'cfp', resource: conference2) }
|
let(:role_cfp) { create(:role, name: 'cfp', resource: conference2) }
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,15 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
feature Event do
|
feature Event do
|
||||||
let!(:conference) { create(:conference) }
|
let!(:conference) { create(:conference, call_for_paper: create(:call_for_paper)) }
|
||||||
let!(:organizer_role) { create(:organizer_role, resource: conference) }
|
let!(:organizer_role) { create(:organizer_role, resource: conference) }
|
||||||
let!(:organizer) { create(:user, email: 'admin@example.com', role_ids: [organizer_role.id]) }
|
let!(:organizer) { create(:user, email: 'admin@example.com', role_ids: [organizer_role.id]) }
|
||||||
let!(:participant) { create(:user) }
|
let!(:participant) { create(:user) }
|
||||||
let!(:participant_without_bio) { create(:user, biography: '') }
|
let!(:participant_without_bio) { create(:user, biography: '') }
|
||||||
|
|
||||||
before(:each) do
|
before(:each) do
|
||||||
conference.call_for_paper = create(:call_for_paper)
|
|
||||||
conference.event_types = [create(:event_type)]
|
|
||||||
|
|
||||||
@options = {}
|
@options = {}
|
||||||
@options[:send_mail] = 'false'
|
@options[:send_mail] = 'false'
|
||||||
|
|
||||||
@event = create(:event, conference: conference, title: 'Example Proposal')
|
@event = create(:event, conference: conference, title: 'Example Proposal')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -101,7 +97,7 @@ feature Event do
|
||||||
expect(page.has_content?('Unconfirmed')).to be true
|
expect(page.has_content?('Unconfirmed')).to be true
|
||||||
click_link "confirm_proposal_#{@event.id}"
|
click_link "confirm_proposal_#{@event.id}"
|
||||||
expect(flash).
|
expect(flash).
|
||||||
to eq('The proposal was confirmed. Please register to attend the conference.')
|
to eq('The proposal was confirmed. Please register to attend the conference.')
|
||||||
@event.reload
|
@event.reload
|
||||||
expect(@event.state).to eq('confirmed')
|
expect(@event.state).to eq('confirmed')
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -10,12 +10,10 @@ feature Conference do
|
||||||
|
|
||||||
sign_in organizer
|
sign_in organizer
|
||||||
|
|
||||||
visit edit_admin_conference_venue_path(
|
# create the venue
|
||||||
|
visit admin_conference_venue_path(
|
||||||
conference_id: conference.short_title)
|
conference_id: conference.short_title)
|
||||||
|
click_link 'Create Venue'
|
||||||
expect(page.find("//*[@id='venue_submit_action']").
|
|
||||||
text).to eq('Update Venue')
|
|
||||||
|
|
||||||
fill_in 'venue_name', with: 'Example University'
|
fill_in 'venue_name', with: 'Example University'
|
||||||
fill_in 'venue_street', with: 'Example Street 42'
|
fill_in 'venue_street', with: 'Example Street 42'
|
||||||
fill_in 'venue_city', with: 'Example City'
|
fill_in 'venue_city', with: 'Example City'
|
||||||
|
|
@ -25,12 +23,9 @@ feature Conference do
|
||||||
fill_in 'venue_description',
|
fill_in 'venue_description',
|
||||||
with: 'Lorem ipsum dolor sit amet, consetetur' \
|
with: 'Lorem ipsum dolor sit amet, consetetur' \
|
||||||
'sadipscing elitr, sed diam nonumy eirmod tempor'
|
'sadipscing elitr, sed diam nonumy eirmod tempor'
|
||||||
|
click_button 'Create Venue'
|
||||||
click_button 'Update Venue'
|
|
||||||
|
|
||||||
expect(flash).
|
expect(flash).
|
||||||
to eq('Venue was successfully updated.')
|
to eq('Venue was successfully created.')
|
||||||
|
|
||||||
venue = Conference.find(conference.id).venue
|
venue = Conference.find(conference.id).venue
|
||||||
expect(venue.name).to eq('Example University')
|
expect(venue.name).to eq('Example University')
|
||||||
expect(venue.street).to eq('Example Street 42')
|
expect(venue.street).to eq('Example Street 42')
|
||||||
|
|
@ -38,16 +33,16 @@ feature Conference do
|
||||||
expect(venue.description).to eq('Lorem ipsum dolor sit amet, consetetur' \
|
expect(venue.description).to eq('Lorem ipsum dolor sit amet, consetetur' \
|
||||||
'sadipscing elitr, sed diam nonumy eirmod tempor')
|
'sadipscing elitr, sed diam nonumy eirmod tempor')
|
||||||
|
|
||||||
|
# edit the venue
|
||||||
click_link 'Edit Venue'
|
click_link 'Edit Venue'
|
||||||
|
expect(page.find("//*[@id='venue_submit_action']").
|
||||||
|
text).to eq('Update Venue')
|
||||||
fill_in 'venue_name', with: 'Example University new'
|
fill_in 'venue_name', with: 'Example University new'
|
||||||
fill_in 'venue_website', with: 'www.example.com new'
|
fill_in 'venue_website', with: 'www.example.com new'
|
||||||
fill_in 'venue_description',
|
fill_in 'venue_description', with: 'new'
|
||||||
with: 'new'
|
|
||||||
|
|
||||||
click_button 'Update Venue'
|
click_button 'Update Venue'
|
||||||
expect(flash).
|
expect(flash).
|
||||||
to eq('Venue was successfully updated.')
|
to eq('Venue was successfully updated.')
|
||||||
|
|
||||||
venue.reload
|
venue.reload
|
||||||
expect(venue.name).to eq('Example University new')
|
expect(venue.name).to eq('Example University new')
|
||||||
expect(venue.website).to eq('www.example.com new')
|
expect(venue.website).to eq('www.example.com new')
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ describe 'User' do
|
||||||
let(:user){ nil }
|
let(:user){ nil }
|
||||||
|
|
||||||
let(:conference_not_public) { create(:conference, splashpage: create(:splashpage, public: false)) }
|
let(:conference_not_public) { create(:conference, splashpage: create(:splashpage, public: false)) }
|
||||||
let(:conference_public) { create(:conference, splashpage: create(:splashpage, public: true), call_for_paper: create(:call_for_paper, schedule_public: true)) }
|
let(:conference_public) { create(:full_conference, splashpage: create(:splashpage, public: true), call_for_paper: create(:call_for_paper, schedule_public: true)) }
|
||||||
|
|
||||||
let(:event_confirmed) { create(:event, state: 'confirmed') }
|
let(:event_confirmed) { create(:event, state: 'confirmed') }
|
||||||
let(:event_unconfirmed) { create(:event) }
|
let(:event_unconfirmed) { create(:event) }
|
||||||
|
|
@ -47,7 +47,7 @@ describe 'User' do
|
||||||
end
|
end
|
||||||
|
|
||||||
# Test abilities for signed in users (without any role)
|
# Test abilities for signed in users (without any role)
|
||||||
context 'when user is a Signed In User' do
|
context 'when user is signed in' do
|
||||||
let(:user) { create(:user) }
|
let(:user) { create(:user) }
|
||||||
let(:user2) { create(:user) }
|
let(:user2) { create(:user) }
|
||||||
let(:subscription) { create(:subscription, user: user) }
|
let(:subscription) { create(:subscription, user: user) }
|
||||||
|
|
@ -84,91 +84,233 @@ describe 'User' do
|
||||||
it{ should be_able_to(:manage, :all) }
|
it{ should be_able_to(:manage, :all) }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when user is an organizer' do
|
context 'when user has the role organizer' do
|
||||||
let!(:conference1) { create(:conference) }
|
let!(:my_conference) { create(:full_conference) }
|
||||||
let!(:conference2) { create(:conference) }
|
let(:role) { create(:organizer_role, resource: my_conference) }
|
||||||
let(:role) { create(:organizer_role, resource: conference1) }
|
let(:user) { create(:user, role_ids: [role.id], is_admin: false) }
|
||||||
let(:user) { create(:user, role_ids: [role.id]) }
|
let(:registration) { create(:registration, conference: my_conference) }
|
||||||
let(:someuser) { create(:user) }
|
let(:other_registration) { create(:registration, conference: conference_public) }
|
||||||
let(:registration_public) { create(:registration, user: someuser, conference_id: conference1.id) }
|
let(:event) { create(:event_full, conference: my_conference) }
|
||||||
|
let(:other_event) { create(:event_full, conference: conference_public) }
|
||||||
|
|
||||||
it{ should be_able_to(:manage, conference1) }
|
it{ should be_able_to([:create, :new], Conference) }
|
||||||
it{ should_not be_able_to(:manage, conference2) }
|
it{ should be_able_to(:manage, my_conference) }
|
||||||
it{ should be_able_to(:manage, registration_public) }
|
it{ should_not be_able_to(:manage, conference_public) }
|
||||||
it{ should be_able_to(:create, Registration) }
|
it{ should be_able_to(:manage, my_conference.splashpage) }
|
||||||
end
|
it{ should_not be_able_to(:manage, conference_public.splashpage) }
|
||||||
|
it{ should be_able_to(:manage, my_conference.contact) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.contact) }
|
||||||
|
it{ should be_able_to(:manage, my_conference.email_settings) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.email_settings) }
|
||||||
|
it{ should be_able_to(:manage, my_conference.campaigns.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.campaigns.first) }
|
||||||
|
it{ should be_able_to(:manage, my_conference.targets.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.targets.first) }
|
||||||
|
it{ should be_able_to(:manage, my_conference.commercials.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.commercials.first) }
|
||||||
|
it{ should be_able_to(:manage, my_conference.registration_period) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.registration_period) }
|
||||||
|
it{ should be_able_to(:manage, my_conference.questions.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.questions.first) }
|
||||||
|
it{ should be_able_to(:manage, my_conference.call_for_paper) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.call_for_paper) }
|
||||||
|
it{ should be_able_to(:manage, my_conference.venue) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.venue) }
|
||||||
|
it{ should be_able_to(:manage, my_conference.lodgings.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.lodgings.first) }
|
||||||
|
it{ should be_able_to(:manage, my_conference.sponsors.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.sponsors.first) }
|
||||||
|
it{ should be_able_to(:manage, my_conference.sponsorship_levels.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.sponsorship_levels.first) }
|
||||||
|
it{ should be_able_to(:manage, my_conference.tickets.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.tickets.first) }
|
||||||
|
|
||||||
context 'when user is part of cfp' do
|
it{ should be_able_to(:manage, registration) }
|
||||||
let!(:conference1) { create(:conference) }
|
it{ should_not be_able_to(:manage, other_registration) }
|
||||||
let!(:conference2) { create(:conference) }
|
|
||||||
let(:role) { create(:role, name: 'cfp', resource: conference1) }
|
|
||||||
let(:user) { create(:user, role_ids: role.id) }
|
|
||||||
let(:event) { create(:event, conference_id: conference1.id) }
|
|
||||||
let(:event_unconfirmed) { create(:event, conference_id: conference2.id) }
|
|
||||||
let(:cfp) { create(:call_for_paper, conference: conference1) }
|
|
||||||
|
|
||||||
it{ should_not be_able_to(:manage, conference1) }
|
|
||||||
it{ should_not be_able_to(:manage, conference2) }
|
|
||||||
it{ should be_able_to(:index, conference1) }
|
|
||||||
it{ should be_able_to(:show, conference1) }
|
|
||||||
|
|
||||||
it{ should be_able_to(:manage, event) }
|
it{ should be_able_to(:manage, event) }
|
||||||
it{ should_not be_able_to(:manage, event_unconfirmed) }
|
it{ should_not be_able_to(:manage, other_event) }
|
||||||
|
it{ should be_able_to(:manage, event.event_type) }
|
||||||
it{ should be_able_to(:manage, cfp) }
|
it{ should_not be_able_to(:manage, other_event.event_type) }
|
||||||
it{ should be_able_to(:manage, create(:event_type, conference: conference1)) }
|
it{ should be_able_to(:manage, event.track) }
|
||||||
|
it{ should_not be_able_to(:manage, other_event.track) }
|
||||||
|
it{ should be_able_to(:manage, event.difficulty_level) }
|
||||||
|
it{ should_not be_able_to(:manage, other_event.difficulty_level) }
|
||||||
|
it{ should be_able_to(:manage, event.commercials.first) }
|
||||||
|
it{ should_not be_able_to(:manage, other_event.commercials.first) }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when user has multiple roles' do
|
context 'when user has the role cfp' do
|
||||||
let!(:conference1) { create(:conference) } # user is organizer
|
let!(:my_conference) { create(:full_conference) }
|
||||||
let!(:conference2) { create(:conference) } # user is cfp
|
let(:role) { create(:cfp_role, resource: my_conference) }
|
||||||
let!(:conference3) { create(:conference) } # user is info_desk
|
let(:user) { create(:user, role_ids: [role.id], is_admin: false) }
|
||||||
let!(:conference4) { create(:conference) } # user is volunteer coordinator
|
let(:registration) { create(:registration, conference: my_conference) }
|
||||||
let!(:conference5) { create(:conference, splashpage: create(:splashpage, public: true)) } # user has no role
|
let(:other_registration) { create(:registration, conference: conference_public) }
|
||||||
let!(:conference6) { create(:conference, splashpage: create(:splashpage, public: false)) } # user has no role
|
let(:event) { create(:event_full, conference: my_conference) }
|
||||||
let(:role_organizer) { create(:role, name: 'organizer', resource: conference1) }
|
let(:other_event) { create(:event_full, conference: conference_public) }
|
||||||
let(:role_cfp) { create(:role, name: 'cfp', resource: conference2) }
|
|
||||||
let(:role_info_desk) { create(:role, name: 'info_desk', resource: conference3) }
|
|
||||||
let(:role_volunteer_coordinator) { create(:role, name: 'volunteer_coordinator', resource: conference4) }
|
|
||||||
let(:user) { create(:user, role_ids: [role_cfp.id, role_organizer.id, role_cfp.id, role_info_desk.id, role_volunteer_coordinator.id]) }
|
|
||||||
let(:admin) { create(:admin) }
|
|
||||||
|
|
||||||
it{ should be_able_to(:manage, conference1) }
|
it{ should_not be_able_to([:create, :new], Conference.new) }
|
||||||
it{ should_not be_able_to(:update, conference2) }
|
it{ should_not be_able_to(:manage, my_conference) }
|
||||||
it{ should_not be_able_to(:update, conference3) }
|
it{ should_not be_able_to(:manage, conference_public) }
|
||||||
it{ should_not be_able_to(:update, conference4) }
|
it{ should_not be_able_to(:manage, my_conference.splashpage) }
|
||||||
it{ should_not be_able_to(:update, conference5) }
|
it{ should_not be_able_to(:manage, conference_public.splashpage) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.contact) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.contact) }
|
||||||
|
it{ should be_able_to(:manage, my_conference.email_settings) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.email_settings) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.campaigns.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.campaigns.first) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.targets.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.targets.first) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.commercials.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.commercials.first) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.registration_period) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.registration_period) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.questions.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.questions.first) }
|
||||||
|
it{ should be_able_to(:manage, my_conference.call_for_paper) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.call_for_paper) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.venue) }
|
||||||
|
it{ should be_able_to(:index, my_conference.venue) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.venue) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.lodgings.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.lodgings.first) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.sponsors.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.sponsors.first) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.sponsorship_levels.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.sponsorship_levels.first) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.tickets.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.tickets.first) }
|
||||||
|
|
||||||
it{ should be_able_to(:show, conference1) }
|
it{ should_not be_able_to(:manage, registration) }
|
||||||
it{ should be_able_to(:show, conference2) }
|
it{ should_not be_able_to(:manage, other_registration) }
|
||||||
it{ should be_able_to(:show, conference3) }
|
|
||||||
it{ should be_able_to(:show, conference4) }
|
|
||||||
it{ should be_able_to(:show, conference5) }
|
|
||||||
it{ should be_able_to(:show, conference6) }
|
|
||||||
|
|
||||||
it{ should be_able_to(:manage, conference1.venue) }
|
it{ should be_able_to(:manage, event) }
|
||||||
it{ should_not be_able_to(:manage, conference2.venue) }
|
it{ should_not be_able_to(:manage, other_event) }
|
||||||
it{ should_not be_able_to(:manage, conference3.venue) }
|
it{ should be_able_to(:manage, event.event_type) }
|
||||||
it{ should_not be_able_to(:manage, conference4.venue) }
|
it{ should_not be_able_to(:manage, other_event.event_type) }
|
||||||
it{ should_not be_able_to(:manage, conference5.venue) }
|
it{ should be_able_to(:manage, event.track) }
|
||||||
|
it{ should_not be_able_to(:manage, other_event.track) }
|
||||||
|
it{ should be_able_to(:manage, event.difficulty_level) }
|
||||||
|
it{ should_not be_able_to(:manage, other_event.difficulty_level) }
|
||||||
|
it{ should be_able_to(:manage, event.commercials.first) }
|
||||||
|
it{ should_not be_able_to(:manage, other_event.commercials.first) }
|
||||||
|
end
|
||||||
|
|
||||||
it{ should be_able_to(:manage, conference1.registrations.new) }
|
context 'when user has the role info_desk' do
|
||||||
it{ should_not be_able_to(:manage, conference2.registrations.new) }
|
let!(:my_conference) { create(:full_conference) }
|
||||||
it{ should be_able_to(:manage, conference3.registrations.new) }
|
let(:role) { create(:info_desk_role, resource: my_conference) }
|
||||||
it{ should_not be_able_to(:manage, conference4.registrations.new) }
|
let(:user) { create(:user, role_ids: [role.id], is_admin: false) }
|
||||||
it{ should_not be_able_to(:manage, conference5.registrations.new) }
|
let(:registration) { create(:registration, conference: my_conference) }
|
||||||
|
let(:other_registration) { create(:registration, conference: conference_public) }
|
||||||
|
let(:event) { create(:event_full, conference: my_conference) }
|
||||||
|
let(:other_event) { create(:event_full, conference: conference_public) }
|
||||||
|
|
||||||
it{ should be_able_to(:manage, conference1.events.new) }
|
it{ should_not be_able_to([:create, :new], Conference.new) }
|
||||||
it{ should be_able_to(:manage, conference2.events.new) }
|
it{ should_not be_able_to(:manage, my_conference) }
|
||||||
it{ should_not be_able_to(:manage, conference3.events.new) }
|
it{ should_not be_able_to(:manage, conference_public) }
|
||||||
it{ should_not be_able_to(:manage, conference4.events.new) }
|
it{ should_not be_able_to(:manage, my_conference.splashpage) }
|
||||||
it{ should_not be_able_to(:manage, conference5.events.new) }
|
it{ should_not be_able_to(:manage, conference_public.splashpage) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.contact) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.contact) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.email_settings) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.email_settings) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.campaigns.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.campaigns.first) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.targets.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.targets.first) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.commercials.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.commercials.first) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.registration_period) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.registration_period) }
|
||||||
|
it{ should be_able_to(:manage, my_conference.questions.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.questions.first) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.call_for_paper) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.call_for_paper) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.venue) }
|
||||||
|
it{ should_not be_able_to(:index, my_conference.venue) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.venue) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.lodgings.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.lodgings.first) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.sponsors.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.sponsors.first) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.sponsorship_levels.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.sponsorship_levels.first) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.tickets.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.tickets.first) }
|
||||||
|
|
||||||
it{ should be_able_to(:manage, Question.new(conference_id: conference1.id)) }
|
it{ should be_able_to(:manage, registration) }
|
||||||
it{ should_not be_able_to(:manage, Question.new(conference_id: conference2.id)) }
|
it{ should_not be_able_to(:manage, other_registration) }
|
||||||
it{ should be_able_to(:manage, Question.new(conference_id: conference3.id)) }
|
|
||||||
it{ should_not be_able_to(:manage, Question.new(conference_id: conference4.id)) }
|
it{ should_not be_able_to(:manage, event) }
|
||||||
it{ should_not be_able_to(:manage, Question.new(conference_id: conference5.id)) }
|
it{ should_not be_able_to(:manage, other_event) }
|
||||||
|
it{ should_not be_able_to(:manage, event.event_type) }
|
||||||
|
it{ should_not be_able_to(:manage, other_event.event_type) }
|
||||||
|
it{ should_not be_able_to(:manage, event.track) }
|
||||||
|
it{ should_not be_able_to(:manage, other_event.track) }
|
||||||
|
it{ should_not be_able_to(:manage, event.difficulty_level) }
|
||||||
|
it{ should_not be_able_to(:manage, other_event.difficulty_level) }
|
||||||
|
it{ should_not be_able_to(:manage, event.commercials.first) }
|
||||||
|
it{ should_not be_able_to(:manage, other_event.commercials.first) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when user has the role volunteers_coordinator' do
|
||||||
|
let!(:my_conference) { create(:full_conference) }
|
||||||
|
let(:role) { create(:volunteers_coordinator_role, resource: my_conference) }
|
||||||
|
let(:user) { create(:user, role_ids: [role.id], is_admin: false) }
|
||||||
|
let(:registration) { create(:registration, conference: my_conference) }
|
||||||
|
let(:other_registration) { create(:registration, conference: conference_public) }
|
||||||
|
let(:event) { create(:event_full, conference: my_conference) }
|
||||||
|
let(:other_event) { create(:event_full, conference: conference_public) }
|
||||||
|
|
||||||
|
it{ should_not be_able_to([:create, :new], Conference.new) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.splashpage) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.splashpage) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.contact) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.contact) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.email_settings) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.email_settings) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.campaigns.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.campaigns.first) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.targets.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.targets.first) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.commercials.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.commercials.first) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.registration_period) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.registration_period) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.questions.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.questions.first) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.call_for_paper) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.call_for_paper) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.venue) }
|
||||||
|
it{ should_not be_able_to(:index, my_conference.venue) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.venue) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.lodgings.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.lodgings.first) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.sponsors.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.sponsors.first) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.sponsorship_levels.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.sponsorship_levels.first) }
|
||||||
|
it{ should_not be_able_to(:manage, my_conference.tickets.first) }
|
||||||
|
it{ should_not be_able_to(:manage, conference_public.tickets.first) }
|
||||||
|
|
||||||
|
it{ should_not be_able_to(:manage, registration) }
|
||||||
|
it{ should_not be_able_to(:manage, other_registration) }
|
||||||
|
|
||||||
|
it{ should_not be_able_to(:manage, event) }
|
||||||
|
it{ should_not be_able_to(:manage, other_event) }
|
||||||
|
it{ should_not be_able_to(:manage, event.event_type) }
|
||||||
|
it{ should_not be_able_to(:manage, other_event.event_type) }
|
||||||
|
it{ should_not be_able_to(:manage, event.track) }
|
||||||
|
it{ should_not be_able_to(:manage, other_event.track) }
|
||||||
|
it{ should_not be_able_to(:manage, event.difficulty_level) }
|
||||||
|
it{ should_not be_able_to(:manage, other_event.difficulty_level) }
|
||||||
|
it{ should_not be_able_to(:manage, event.commercials.first) }
|
||||||
|
it{ should_not be_able_to(:manage, other_event.commercials.first) }
|
||||||
|
it 'should be_able to :manage Vposition'
|
||||||
|
it 'should be_able to :manage Vday'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -510,8 +510,8 @@ describe Conference do
|
||||||
describe 'event type distribution' do
|
describe 'event type distribution' do
|
||||||
before do
|
before do
|
||||||
subject.email_settings = create(:email_settings)
|
subject.email_settings = create(:email_settings)
|
||||||
@workshop = create(:event_type, title: 'Workshop', color: '#000000')
|
@workshop = create(:event_type, title: 'Workshop', color: '#000000', conference: subject)
|
||||||
@lecture = create(:event_type, title: 'Lecture', color: '#ffffff')
|
@lecture = create(:event_type, title: 'Lecture', color: '#ffffff', conference: subject)
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#event_type_distribution' do
|
describe '#event_type_distribution' do
|
||||||
|
|
@ -1508,10 +1508,6 @@ describe Conference do
|
||||||
expect(subject.email_settings).not_to be_nil
|
expect(subject.email_settings).not_to be_nil
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'has a venue after creation' do
|
|
||||||
expect(subject.venue).not_to be_nil
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'has a guid after creation' do
|
it 'has a guid after creation' do
|
||||||
expect(subject.guid).not_to be_nil
|
expect(subject.guid).not_to be_nil
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue