From 00d7bfda95087297ea4205946092185d77d1a872 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 19 Jan 2012 09:27:23 +0200 Subject: [PATCH] projects link added. security specs added --- app/assets/images/Storage-UI.PNG | Bin 0 -> 737 bytes app/views/deploy_keys/index.html.haml | 6 +++ app/views/layouts/_head_panel.html.haml | 4 +- spec/requests/projects_deploy_keys_spec.rb | 2 +- spec/requests/projects_security_spec.rb | 45 +++++++++++++++++++++ spec/requests/tags_spec.rb | 27 ------------- spec/requests/team_members_spec.rb | 2 +- 7 files changed, 55 insertions(+), 31 deletions(-) create mode 100644 app/assets/images/Storage-UI.PNG delete mode 100644 spec/requests/tags_spec.rb diff --git a/app/assets/images/Storage-UI.PNG b/app/assets/images/Storage-UI.PNG new file mode 100644 index 0000000000000000000000000000000000000000..8ab6678de325550c5c504ee383df323f80b5c5d6 GIT binary patch literal 737 zcmeAS@N?(olHy`uVBq!ia0y~yV2}b~4mJh`hLv7E=NK3m7>k44ofy`glX=O&z`&N| z?e4NwsZdZYYYrb ziJmTwAs)xKUi0s`8Y*(&3)I8V{YP%zloy0BGviDLoBk{FhC(Gn65ol0IC z9XZOg?Sijvw8k~HbF+IzmWA!e2ow~Y5~0-6r?6#3X58%0ljZwoe!utP^?|3~f8VWs z_xE1$`=6g*J8ZvgYHt2rLeAVS^3dKhF>lItTL}pIKT_V4xaX6d-I+7@QcCwkOwj-E ze1^j8k9u~8d)c-un|J@wT%+HKDNOQ@eb=;}v}@%vTNM7DU-|5xIOn|be~tOm8o#jV z+>pL{uwHU-q)wU`tPkpw$GdpISJfm$9 z6}GQ+|0}(m? z?p&tdZrd!Mweh<4Hool-?(?4J(w^G+?|oeCkDWz7=V!l(%#kgLIo&9xeOs|A}|bcXyw>6}_=~rp`Udg$LH|^0^}ytoeSc`6WH!4cy|#r|^_LexLQ-@%pM| vJ-^FebJXq6zxLgTe~DWM4f+y!5X literal 0 HcmV?d00001 diff --git a/app/views/deploy_keys/index.html.haml b/app/views/deploy_keys/index.html.haml index d3feadb8742..015b818c76b 100644 --- a/app/views/deploy_keys/index.html.haml +++ b/app/views/deploy_keys/index.html.haml @@ -5,6 +5,12 @@ - @keys.each do |key| = render(:partial => 'show', :locals => {:key => key}) +- if @keys.blank? + .notice_holder + %li Deploy Keys do not exist yet. + - if can? current_user, :admin_project, @project + %li You can add a new one by clicking on plus icon + :javascript $('.delete-key').live('ajax:success', function() { $(this).closest('.update-item').fadeOut(); }); diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml index 101b411072f..f65f20ea722 100644 --- a/app/views/layouts/_head_panel.html.haml +++ b/app/views/layouts/_head_panel.html.haml @@ -5,8 +5,8 @@ %div.main_links = link_to root_path, :class => "home", :title => "Home" do = image_tag "Home-UI.PNG" - = link_to :back, :title => "Back" do - = image_tag "Arrow-Left-UI.PNG" + = link_to projects_path, :title => "Projects" do + = image_tag "Storage-UI.PNG" - if project_layout .project_name diff --git a/spec/requests/projects_deploy_keys_spec.rb b/spec/requests/projects_deploy_keys_spec.rb index 629c28871a4..580e55229e1 100644 --- a/spec/requests/projects_deploy_keys_spec.rb +++ b/spec/requests/projects_deploy_keys_spec.rb @@ -29,7 +29,7 @@ describe "Projects", "DeployKeys" do end end - describe "New key", :js => true do + describe "New key" do before do visit project_deploy_keys_path(project) click_link "New Deploy Key" diff --git a/spec/requests/projects_security_spec.rb b/spec/requests/projects_security_spec.rb index fb9f3d8cc60..f8942978a46 100644 --- a/spec/requests/projects_security_spec.rb +++ b/spec/requests/projects_security_spec.rb @@ -140,5 +140,50 @@ describe "Projects" do it { project_merge_requests_path(@project).should be_denied_for :user } it { project_merge_requests_path(@project).should be_denied_for :visitor } end + + describe "GET /project_code/repository" do + it { project_repository_path(@project).should be_allowed_for @u1 } + it { project_repository_path(@project).should be_allowed_for @u3 } + it { project_repository_path(@project).should be_denied_for :admin } + it { project_repository_path(@project).should be_denied_for @u2 } + it { project_repository_path(@project).should be_denied_for :user } + it { project_repository_path(@project).should be_denied_for :visitor } + end + + describe "GET /project_code/repository/branches" do + it { branches_project_repository_path(@project).should be_allowed_for @u1 } + it { branches_project_repository_path(@project).should be_allowed_for @u3 } + it { branches_project_repository_path(@project).should be_denied_for :admin } + it { branches_project_repository_path(@project).should be_denied_for @u2 } + it { branches_project_repository_path(@project).should be_denied_for :user } + it { branches_project_repository_path(@project).should be_denied_for :visitor } + end + + describe "GET /project_code/repository/tags" do + it { tags_project_repository_path(@project).should be_allowed_for @u1 } + it { tags_project_repository_path(@project).should be_allowed_for @u3 } + it { tags_project_repository_path(@project).should be_denied_for :admin } + it { tags_project_repository_path(@project).should be_denied_for @u2 } + it { tags_project_repository_path(@project).should be_denied_for :user } + it { tags_project_repository_path(@project).should be_denied_for :visitor } + end + + describe "GET /project_code/hooks" do + it { project_hooks_path(@project).should be_allowed_for @u1 } + it { project_hooks_path(@project).should be_allowed_for @u3 } + it { project_hooks_path(@project).should be_denied_for :admin } + it { project_hooks_path(@project).should be_denied_for @u2 } + it { project_hooks_path(@project).should be_denied_for :user } + it { project_hooks_path(@project).should be_denied_for :visitor } + end + + describe "GET /project_code/files" do + it { files_project_path(@project).should be_allowed_for @u1 } + it { files_project_path(@project).should be_allowed_for @u3 } + it { files_project_path(@project).should be_denied_for :admin } + it { files_project_path(@project).should be_denied_for @u2 } + it { files_project_path(@project).should be_denied_for :user } + it { files_project_path(@project).should be_denied_for :visitor } + end end end diff --git a/spec/requests/tags_spec.rb b/spec/requests/tags_spec.rb deleted file mode 100644 index ff72ab1f890..00000000000 --- a/spec/requests/tags_spec.rb +++ /dev/null @@ -1,27 +0,0 @@ -require 'spec_helper' - -describe "Tags" do - before { login_as :user } - - # describe "GET 'tags/index'" do - # it "should be successful" do - # get 'tags/index' - # response.should be_success - # end - # end - - describe "GET '/tags.json'" do - before do - @project = Factory :project - @project.add_access(@user, :read) - @project.tag_list = 'demo1' - @project.save - visit '/tags.json' - end - - it "should contains tags" do - page.should have_content('demo1') - end -end - -end diff --git a/spec/requests/team_members_spec.rb b/spec/requests/team_members_spec.rb index d949d759cf9..b44f47784c8 100644 --- a/spec/requests/team_members_spec.rb +++ b/spec/requests/team_members_spec.rb @@ -18,7 +18,7 @@ describe "TeamMembers" do end end - describe "New Team member", :js => true do + describe "New Team member" do before do @user_1 = Factory :user visit team_project_path(@project) -- GitLab