diff options
author | Drew Blessing <drew@gitlab.com> | 2015-12-21 14:56:11 -0600 |
---|---|---|
committer | Drew Blessing <drew@gitlab.com> | 2015-12-21 15:58:42 -0600 |
commit | 66a8281fddf8e4f9d39265a6bfb38e8a6a8309c2 (patch) | |
tree | 9000295dcce16e5d319d5e10938d5dfcb6c4c932 /spec | |
parent | f4c05ee45fda4ee2c76f4cbecb0dc6a1f80d2e83 (diff) | |
download | gitlab-ce-66a8281fddf8e4f9d39265a6bfb38e8a6a8309c2.tar.gz |
Fix and test leave project display
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/projects_spec.rb | 14 | ||||
-rw-r--r-- | spec/helpers/projects_helper_spec.rb | 10 |
2 files changed, 24 insertions, 0 deletions
diff --git a/spec/features/projects_spec.rb b/spec/features/projects_spec.rb index 09fcff2444a..74b148f5d17 100644 --- a/spec/features/projects_spec.rb +++ b/spec/features/projects_spec.rb @@ -70,6 +70,20 @@ feature 'Project', feature: true do end end + describe 'leave project link' do + let(:user) { create(:user) } + let(:project) { create(:project, namespace: user.namespace) } + + before do + login_with(user) + project.team.add_user(user, Gitlab::Access::MASTER) + visit namespace_project_path(project.namespace, project) + end + + it { expect(page).to have_content('You have Master access to this project.') } + it { expect(page).to have_link('Leave this project') } + end + def remove_with_confirm(button_text, confirm_with) click_button button_text fill_in 'confirm_name_input', with: confirm_with diff --git a/spec/helpers/projects_helper_spec.rb b/spec/helpers/projects_helper_spec.rb index f2efb528aeb..53207767581 100644 --- a/spec/helpers/projects_helper_spec.rb +++ b/spec/helpers/projects_helper_spec.rb @@ -53,6 +53,16 @@ describe ProjectsHelper do end end + describe 'user_max_access_in_project' do + let(:project) { create(:project) } + let(:user) { create(:user) } + before do + project.team.add_user(user, Gitlab::Access::MASTER) + end + + it { expect(helper.user_max_access_in_project(user.id, project)).to eq('Master') } + end + describe "readme_cache_key" do let(:project) { create(:project) } |