Initial commit

This commit is contained in:
Senad Uka
2020-05-31 22:38:19 +02:00
commit 858fafc3c5
1280 changed files with 65918 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
require "rails_helper"
RSpec.feature "User can see directories on project page", type: :feature do
before do
sign_in(user)
end
let!(:project) { create(:project_with_directories, members: user, account: user.primary_account) }
context "User is an associate" do
let(:user) { create(:user, :associate) }
scenario "user is associate" do
visit project_path(project)
expect(page).to have_link("Add Folder")
expect(page).to have_content("Shared")
expect(page).not_to have_content("Financial Documents")
expect(page).not_to have_content("Salaries")
end
end
context "User is a project manager" do
let(:user) { create(:user, :manager) }
scenario "user is associate" do
visit project_path(project)
expect(page).to have_link("Add Folder")
expect(page).to have_content("Shared")
expect(page).to have_content("Financial Documents")
expect(page).not_to have_content("Salaries")
end
end
context "User is a account manager" do
let(:user) { create(:user, :account_manager) }
let!(:project) { create(:project_with_directories, account: user.primary_account) }
scenario "user is associate" do
visit project_path(project)
expect(page).to have_link("Add Folder")
expect(page).to have_content("Shared")
expect(page).to have_content("Financial Documents")
expect(page).to have_content("Salaries")
end
end
end