|
|
@ -17,10 +17,10 @@ RSpec.describe "User Features" do |
|
|
|
sign_in user |
|
|
|
sign_in user |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "User is a data coordinator" do |
|
|
|
context "when user is a data coordinator" do |
|
|
|
let!(:user) { FactoryBot.create(:user, :data_coordinator) } |
|
|
|
let!(:user) { FactoryBot.create(:user, :data_coordinator) } |
|
|
|
|
|
|
|
|
|
|
|
context "Organisation page" do |
|
|
|
context "when viewing organisation page" do |
|
|
|
it "defaults to organisation details" do |
|
|
|
it "defaults to organisation details" do |
|
|
|
visit("/logs") |
|
|
|
visit("/logs") |
|
|
|
click_link("Your organisation") |
|
|
|
click_link("Your organisation") |
|
|
@ -36,7 +36,7 @@ RSpec.describe "User Features" do |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "Organisation users" do |
|
|
|
context "when users are part of organisation" do |
|
|
|
it "users can be added" do |
|
|
|
it "users can be added" do |
|
|
|
visit("/organisations/#{org_id}") |
|
|
|
visit("/organisations/#{org_id}") |
|
|
|
click_link("Users") |
|
|
|
click_link("Users") |
|
|
@ -65,10 +65,10 @@ RSpec.describe "User Features" do |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "User is a data provider" do |
|
|
|
context "when the user is a data provider" do |
|
|
|
let!(:user) { FactoryBot.create(:user) } |
|
|
|
let(:user) { FactoryBot.create(:user) } |
|
|
|
|
|
|
|
|
|
|
|
context "Organisation page" do |
|
|
|
context "when viewing organisation page" do |
|
|
|
it "can only see the details tab" do |
|
|
|
it "can only see the details tab" do |
|
|
|
visit("/logs") |
|
|
|
visit("/logs") |
|
|
|
click_link("Your organisation") |
|
|
|
click_link("Your organisation") |
|
|
|