Sha256: 04b1a5140e347d3ee9390da8f90fa787ae246227d9faa932feaa07b370029302

Contents?: true

Size: 1.2 KB

Versions: 13

Compression:

Stored size: 1.2 KB

Contents

require "rails_helper"

feature "Clinician - Arms", type: :feature do
  fixtures :all

  describe "Logged in as a clinician" do
    before do
      sign_in users :clinician1
    end

    scenario "should only see the arms - that through groups - have participants that the coach is assigned to" do
      visit "/think_feel_do_dashboard/arms"

      expect(page).to have_link "Arm 1"
      expect(page).to have_link "Arm 2"
      expect(page).to_not have_link "Arm 3"
      expect(page).to_not have_link "Arm 4"

      click_on "Sign Out"
      sign_in users :user2
      visit "/think_feel_do_dashboard/arms"

      expect(page).to have_link "Arm 1"
      expect(page).to_not have_link "Arm 2"
      expect(page).to_not have_link "Arm 3"
      expect(page).to_not have_link "Arm 4"
    end

    scenario "should only see the groups of an arm that a coach is assigned to via coach_assignments" do
      visit "/think_feel_do_dashboard/arms/#{arms(:arm1).id}"

      expect(page).to have_link "Group 3"

      click_on "Sign Out"
      sign_in users :user2
      visit "/think_feel_do_dashboard/arms/#{arms(:arm1).id}"

      expect(page).to have_link "Group 1"
      expect(page).to_not have_link "Group 3"
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
think_feel_do_dashboard-1.2.0.beta1 spec/features/clinician/arms_spec.rb
think_feel_do_dashboard-1.1.21 spec/features/clinician/arms_spec.rb
think_feel_do_dashboard-1.1.20 spec/features/clinician/arms_spec.rb
think_feel_do_dashboard-1.1.19 spec/features/clinician/arms_spec.rb
think_feel_do_dashboard-1.1.18 spec/features/clinician/arms_spec.rb
think_feel_do_dashboard-1.1.17 spec/features/clinician/arms_spec.rb
think_feel_do_dashboard-1.1.16 spec/features/clinician/arms_spec.rb
think_feel_do_dashboard-1.1.15 spec/features/clinician/arms_spec.rb
think_feel_do_dashboard-1.1.14 spec/features/clinician/arms_spec.rb
think_feel_do_dashboard-1.1.13 spec/features/clinician/arms_spec.rb
think_feel_do_dashboard-1.1.12 spec/features/clinician/arms_spec.rb
think_feel_do_dashboard-1.1.11 spec/features/clinician/arms_spec.rb
think_feel_do_dashboard-1.1.10 spec/features/clinician/arms_spec.rb