Sha256: 52a313a375405e0ffdc4979d7a5ca9197198450832eddca24da2117711f8f30d

Contents?: true

Size: 1.34 KB

Versions: 13

Compression:

Stored size: 1.34 KB

Contents

require "rails_helper"

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

  before do
    sign_in users :clinician1
    visit "/think_feel_do_dashboard/arms"
  end

  it "displays the moderate link if the group is social" do
    click_on "Arm 1"
    click_on "Group 1"
    expect(page).to have_link "Moderate"
  end

  it "does NOT display the moderate link if the group is NOT social" do
    click_on "Arm 2"
    click_on "Group 2"
    expect(page).to_not have_link "Moderate"
  end

  it "does display the link to the moderator if you don't have permission" do
    visit "/think_feel_do_dashboard/groups/#{groups(:group1).id}"
    expect(page).to have_text groups(:group1).moderator.email
    expect(page).to_not have_link groups(:group1).moderator.email
  end

  scenario "should display group links" do
    visit "/think_feel_do_dashboard/arms/#{arms(:arm1).id}"

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

  it "displays the correct managment links" do
    visit "/think_feel_do_dashboard/groups/#{groups(:group1).id}"

    expect(page).to have_link "Patient Dashboard"
    expect(page).to have_link "Group Dashboard"
    expect(page).to_not have_link "Manage Tasks"
    expect(page).to have_button "Messaging"
    expect(page).to have_link "Messages"
    expect(page).to have_link "Site Messaging"
    expect(page).to have_link "Moderate"
  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/groups_spec.rb
think_feel_do_dashboard-1.1.21 spec/features/clinician/groups_spec.rb
think_feel_do_dashboard-1.1.20 spec/features/clinician/groups_spec.rb
think_feel_do_dashboard-1.1.19 spec/features/clinician/groups_spec.rb
think_feel_do_dashboard-1.1.18 spec/features/clinician/groups_spec.rb
think_feel_do_dashboard-1.1.17 spec/features/clinician/groups_spec.rb
think_feel_do_dashboard-1.1.16 spec/features/clinician/groups_spec.rb
think_feel_do_dashboard-1.1.15 spec/features/clinician/groups_spec.rb
think_feel_do_dashboard-1.1.14 spec/features/clinician/groups_spec.rb
think_feel_do_dashboard-1.1.13 spec/features/clinician/groups_spec.rb
think_feel_do_dashboard-1.1.12 spec/features/clinician/groups_spec.rb
think_feel_do_dashboard-1.1.11 spec/features/clinician/groups_spec.rb
think_feel_do_dashboard-1.1.10 spec/features/clinician/groups_spec.rb