Merge pull request #75 from CactusPuppy/176895077-Google-Calendar-Link-Should-Be-Visible-only-with-registration
176895077 google calendar link should be visible only with registration
This commit is contained in:
commit
982d62c93d
3 changed files with 38 additions and 14 deletions
20
Gemfile.lock
20
Gemfile.lock
|
|
@ -171,11 +171,15 @@ GEM
|
||||||
railties (>= 3.0.0)
|
railties (>= 3.0.0)
|
||||||
faker (1.9.3)
|
faker (1.9.3)
|
||||||
i18n (>= 0.7)
|
i18n (>= 0.7)
|
||||||
faraday (1.3.0)
|
faraday (1.4.1)
|
||||||
|
faraday-excon (~> 1.1)
|
||||||
faraday-net_http (~> 1.0)
|
faraday-net_http (~> 1.0)
|
||||||
|
faraday-net_http_persistent (~> 1.1)
|
||||||
multipart-post (>= 1.2, < 3)
|
multipart-post (>= 1.2, < 3)
|
||||||
ruby2_keywords
|
ruby2_keywords (>= 0.0.4)
|
||||||
|
faraday-excon (1.1.0)
|
||||||
faraday-net_http (1.0.1)
|
faraday-net_http (1.0.1)
|
||||||
|
faraday-net_http_persistent (1.1.0)
|
||||||
fastimage (2.1.4)
|
fastimage (2.1.4)
|
||||||
feature (1.4.0)
|
feature (1.4.0)
|
||||||
ffi (1.10.0)
|
ffi (1.10.0)
|
||||||
|
|
@ -293,7 +297,7 @@ GEM
|
||||||
mime-types (3.3.1)
|
mime-types (3.3.1)
|
||||||
mime-types-data (~> 3.2015)
|
mime-types-data (~> 3.2015)
|
||||||
mime-types-data (3.2021.0225)
|
mime-types-data (3.2021.0225)
|
||||||
mimemagic (0.4.3)
|
mimemagic (0.3.10)
|
||||||
nokogiri (~> 1)
|
nokogiri (~> 1)
|
||||||
rake
|
rake
|
||||||
mina (1.2.3)
|
mina (1.2.3)
|
||||||
|
|
@ -301,7 +305,7 @@ GEM
|
||||||
rake
|
rake
|
||||||
mini_magick (4.9.5)
|
mini_magick (4.9.5)
|
||||||
mini_mime (1.0.3)
|
mini_mime (1.0.3)
|
||||||
mini_portile2 (2.5.0)
|
mini_portile2 (2.5.1)
|
||||||
minitest (5.14.4)
|
minitest (5.14.4)
|
||||||
momentjs-rails (2.20.1)
|
momentjs-rails (2.20.1)
|
||||||
railties (>= 3.1)
|
railties (>= 3.1)
|
||||||
|
|
@ -320,7 +324,7 @@ GEM
|
||||||
nenv (0.3.0)
|
nenv (0.3.0)
|
||||||
netrc (0.11.0)
|
netrc (0.11.0)
|
||||||
nio4r (2.5.7)
|
nio4r (2.5.7)
|
||||||
nokogiri (1.11.2)
|
nokogiri (1.11.3)
|
||||||
mini_portile2 (~> 2.5.0)
|
mini_portile2 (~> 2.5.0)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
notiffany (0.1.1)
|
notiffany (0.1.1)
|
||||||
|
|
@ -332,7 +336,7 @@ GEM
|
||||||
multi_json (~> 1.3)
|
multi_json (~> 1.3)
|
||||||
multi_xml (~> 0.5)
|
multi_xml (~> 0.5)
|
||||||
rack (>= 1.2, < 3)
|
rack (>= 1.2, < 3)
|
||||||
octokit (4.20.0)
|
octokit (4.21.0)
|
||||||
faraday (>= 0.9)
|
faraday (>= 0.9)
|
||||||
sawyer (~> 0.8.0, >= 0.5.3)
|
sawyer (~> 0.8.0, >= 0.5.3)
|
||||||
omniauth (1.9.1)
|
omniauth (1.9.1)
|
||||||
|
|
@ -496,7 +500,7 @@ GEM
|
||||||
http-cookie (>= 1.0.2, < 2.0)
|
http-cookie (>= 1.0.2, < 2.0)
|
||||||
mime-types (>= 1.16, < 4.0)
|
mime-types (>= 1.16, < 4.0)
|
||||||
netrc (~> 0.8)
|
netrc (~> 0.8)
|
||||||
rexml (3.2.4)
|
rexml (3.2.5)
|
||||||
rolify (5.2.0)
|
rolify (5.2.0)
|
||||||
rqrcode (0.10.1)
|
rqrcode (0.10.1)
|
||||||
chunky_png (~> 1.0)
|
chunky_png (~> 1.0)
|
||||||
|
|
@ -637,7 +641,7 @@ GEM
|
||||||
unf (0.1.4)
|
unf (0.1.4)
|
||||||
unf_ext
|
unf_ext
|
||||||
unf_ext (0.0.7.5)
|
unf_ext (0.0.7.5)
|
||||||
unicode-display_width (1.6.0)
|
unicode-display_width (1.6.1)
|
||||||
unicode_utils (1.4.0)
|
unicode_utils (1.4.0)
|
||||||
unobtrusive_flash (3.3.1)
|
unobtrusive_flash (3.3.1)
|
||||||
railties
|
railties
|
||||||
|
|
|
||||||
|
|
@ -25,9 +25,10 @@
|
||||||
.col-md-4
|
.col-md-4
|
||||||
%p{style: "margin-top: 20px"}
|
%p{style: "margin-top: 20px"}
|
||||||
- if @event_schedule&.start_time
|
- if @event_schedule&.start_time
|
||||||
= link_to google_calendar_link(@event_schedule), target: '_blank', class: 'btn btn-success btn-mini' do
|
- if user_signed_in?
|
||||||
%i.fa.fa-calendar
|
= link_to google_calendar_link(@event_schedule), target: '_blank', class: 'btn btn-success btn-mini' do
|
||||||
Add to Google Calendar (beta)
|
%i.fa.fa-calendar
|
||||||
|
Add to Google Calendar (beta)
|
||||||
- if can?(:update, @event) && @event.require_registration?
|
- if can?(:update, @event) && @event.require_registration?
|
||||||
= link_to 'Registrations', registrations_conference_program_proposal_path(@conference.short_title, @event), class: 'btn btn-mini btn-success'
|
= link_to 'Registrations', registrations_conference_program_proposal_path(@conference.short_title, @event), class: 'btn btn-mini btn-success'
|
||||||
- if can?(:edit, @event)
|
- if can?(:edit, @event)
|
||||||
|
|
|
||||||
|
|
@ -213,7 +213,28 @@ feature Event do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'happening now or next section', feature: true, js: true do
|
context 'as a user, looking at a conference with scheduled events' do
|
||||||
|
before(:each) do
|
||||||
|
@program = conference.program
|
||||||
|
@selected_schedule = create(:schedule, program: @program)
|
||||||
|
@program.update_attributes!(selected_schedule: @selected_schedule)
|
||||||
|
@scheduled_event1 = create(:event, program: @program, state: 'confirmed', abstract: '`markdown`')
|
||||||
|
@event_schedule1 = create(:event_schedule, event: @scheduled_event1, schedule: @selected_schedule, start_time: conference.start_hour + 1.hour)
|
||||||
|
end
|
||||||
|
|
||||||
|
scenario 'for a scheduled event, can add an event to google calendar if signed in', feature: true do
|
||||||
|
sign_in participant
|
||||||
|
visit conference_program_proposal_path(conference.short_title, @scheduled_event1.id)
|
||||||
|
expect(page).to have_content('Add to Google Calendar (beta)')
|
||||||
|
end
|
||||||
|
|
||||||
|
scenario 'for a scheduled event, cannot add an event to google calendar if not signed on', feature: true do
|
||||||
|
visit conference_program_proposal_path(conference.short_title, @scheduled_event1.id)
|
||||||
|
expect(page).not_to have_content('Add to Google Calendar (beta)')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'happening now or next section' do
|
||||||
let!(:conference1) { create(:full_conference, start_date: 1.day.ago, end_date: 7.days.from_now, start_hour: 0, end_hour: 24) }
|
let!(:conference1) { create(:full_conference, start_date: 1.day.ago, end_date: 7.days.from_now, start_hour: 0, end_hour: 24) }
|
||||||
let!(:program) { conference1.program }
|
let!(:program) { conference1.program }
|
||||||
let!(:selected_schedule) { create(:schedule, program: program) }
|
let!(:selected_schedule) { create(:schedule, program: program) }
|
||||||
|
|
@ -311,9 +332,7 @@ feature Event do
|
||||||
expect(happening_now).not_to have_content(event_schedule3.event.title)
|
expect(happening_now).not_to have_content(event_schedule3.event.title)
|
||||||
expect(happening_now).not_to have_content(event_schedule1.event.title)
|
expect(happening_now).not_to have_content(event_schedule1.event.title)
|
||||||
expect(happening_now).not_to have_content(event_schedule2.event.title)
|
expect(happening_now).not_to have_content(event_schedule2.event.title)
|
||||||
|
|
||||||
expect(happening_now).to have_content(event_schedule4.event.title)
|
expect(happening_now).to have_content(event_schedule4.event.title)
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue