1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
From 1b42ed84a5ac4394b1d135127c98194d073f025c Mon Sep 17 00:00:00 2001 From: cedricnjanga Date: Thu, 29 Mar 2018 19:30:41 -0700 Subject: Refs #6258 Add speac feature for calendars and fix begin_of_association_chain in controller --- app/controllers/calendars_controller.rb | 2 +- spec/features/calendars_spec.rb | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 spec/features/calendars_spec.rb diff --git a/app/controllers/calendars_controller.rb b/app/controllers/calendars_controller.rb index 2f25d95d6..a6f31eead 100644 --- a/app/controllers/calendars_controller.rb +++ b/app/controllers/calendars_controller.rb @@ -104,7 +104,7 @@ class CalendarsController < ChouetteController end end - def begin_of_chain + def begin_of_association_chain current_organisation end diff --git a/spec/features/calendars_spec.rb b/spec/features/calendars_spec.rb new file mode 100644 index 000000000..26220746b --- /dev/null +++ b/spec/features/calendars_spec.rb @@ -0,0 +1,16 @@ +RSpec.describe 'Calendars', type: :feature do + login_user + + let(:calendar1) { create(:calendar, workgroup: @user.organisation.workgroups.first, organisation: @user.organisation) } + let(:calendar2) { create(:calendar) } + + describe "index" do + before(:each) do + visit workgroup_calendars_path(calendar1.workgroup) + end + it "should only display calendars from same workgroup" do + expect(page).to have_content calendar1.name + expect(page).to_not have_content calendar2.name + end + end +end \ No newline at end of file -- cgit v1.2.3 42'>logtreecommitdiffstats