Commit 00d7bfda95087297ea4205946092185d77d1a872
1 parent
15c46555
Exists in
master
and in
4 other branches
projects link added. security specs added
Showing
7 changed files
with
55 additions
and
31 deletions
Show diff stats
737 Bytes
app/views/deploy_keys/index.html.haml
| @@ -5,6 +5,12 @@ | @@ -5,6 +5,12 @@ | ||
| 5 | - @keys.each do |key| | 5 | - @keys.each do |key| |
| 6 | = render(:partial => 'show', :locals => {:key => key}) | 6 | = render(:partial => 'show', :locals => {:key => key}) |
| 7 | 7 | ||
| 8 | +- if @keys.blank? | ||
| 9 | + .notice_holder | ||
| 10 | + %li Deploy Keys do not exist yet. | ||
| 11 | + - if can? current_user, :admin_project, @project | ||
| 12 | + %li You can add a new one by clicking on plus icon | ||
| 13 | + | ||
| 8 | :javascript | 14 | :javascript |
| 9 | $('.delete-key').live('ajax:success', function() { | 15 | $('.delete-key').live('ajax:success', function() { |
| 10 | $(this).closest('.update-item').fadeOut(); }); | 16 | $(this).closest('.update-item').fadeOut(); }); |
app/views/layouts/_head_panel.html.haml
| @@ -5,8 +5,8 @@ | @@ -5,8 +5,8 @@ | ||
| 5 | %div.main_links | 5 | %div.main_links |
| 6 | = link_to root_path, :class => "home", :title => "Home" do | 6 | = link_to root_path, :class => "home", :title => "Home" do |
| 7 | = image_tag "Home-UI.PNG" | 7 | = image_tag "Home-UI.PNG" |
| 8 | - = link_to :back, :title => "Back" do | ||
| 9 | - = image_tag "Arrow-Left-UI.PNG" | 8 | + = link_to projects_path, :title => "Projects" do |
| 9 | + = image_tag "Storage-UI.PNG" | ||
| 10 | 10 | ||
| 11 | - if project_layout | 11 | - if project_layout |
| 12 | .project_name | 12 | .project_name |
spec/requests/projects_deploy_keys_spec.rb
| @@ -29,7 +29,7 @@ describe "Projects", "DeployKeys" do | @@ -29,7 +29,7 @@ describe "Projects", "DeployKeys" do | ||
| 29 | end | 29 | end |
| 30 | end | 30 | end |
| 31 | 31 | ||
| 32 | - describe "New key", :js => true do | 32 | + describe "New key" do |
| 33 | before do | 33 | before do |
| 34 | visit project_deploy_keys_path(project) | 34 | visit project_deploy_keys_path(project) |
| 35 | click_link "New Deploy Key" | 35 | click_link "New Deploy Key" |
spec/requests/projects_security_spec.rb
| @@ -140,5 +140,50 @@ describe "Projects" do | @@ -140,5 +140,50 @@ describe "Projects" do | ||
| 140 | it { project_merge_requests_path(@project).should be_denied_for :user } | 140 | it { project_merge_requests_path(@project).should be_denied_for :user } |
| 141 | it { project_merge_requests_path(@project).should be_denied_for :visitor } | 141 | it { project_merge_requests_path(@project).should be_denied_for :visitor } |
| 142 | end | 142 | end |
| 143 | + | ||
| 144 | + describe "GET /project_code/repository" do | ||
| 145 | + it { project_repository_path(@project).should be_allowed_for @u1 } | ||
| 146 | + it { project_repository_path(@project).should be_allowed_for @u3 } | ||
| 147 | + it { project_repository_path(@project).should be_denied_for :admin } | ||
| 148 | + it { project_repository_path(@project).should be_denied_for @u2 } | ||
| 149 | + it { project_repository_path(@project).should be_denied_for :user } | ||
| 150 | + it { project_repository_path(@project).should be_denied_for :visitor } | ||
| 151 | + end | ||
| 152 | + | ||
| 153 | + describe "GET /project_code/repository/branches" do | ||
| 154 | + it { branches_project_repository_path(@project).should be_allowed_for @u1 } | ||
| 155 | + it { branches_project_repository_path(@project).should be_allowed_for @u3 } | ||
| 156 | + it { branches_project_repository_path(@project).should be_denied_for :admin } | ||
| 157 | + it { branches_project_repository_path(@project).should be_denied_for @u2 } | ||
| 158 | + it { branches_project_repository_path(@project).should be_denied_for :user } | ||
| 159 | + it { branches_project_repository_path(@project).should be_denied_for :visitor } | ||
| 160 | + end | ||
| 161 | + | ||
| 162 | + describe "GET /project_code/repository/tags" do | ||
| 163 | + it { tags_project_repository_path(@project).should be_allowed_for @u1 } | ||
| 164 | + it { tags_project_repository_path(@project).should be_allowed_for @u3 } | ||
| 165 | + it { tags_project_repository_path(@project).should be_denied_for :admin } | ||
| 166 | + it { tags_project_repository_path(@project).should be_denied_for @u2 } | ||
| 167 | + it { tags_project_repository_path(@project).should be_denied_for :user } | ||
| 168 | + it { tags_project_repository_path(@project).should be_denied_for :visitor } | ||
| 169 | + end | ||
| 170 | + | ||
| 171 | + describe "GET /project_code/hooks" do | ||
| 172 | + it { project_hooks_path(@project).should be_allowed_for @u1 } | ||
| 173 | + it { project_hooks_path(@project).should be_allowed_for @u3 } | ||
| 174 | + it { project_hooks_path(@project).should be_denied_for :admin } | ||
| 175 | + it { project_hooks_path(@project).should be_denied_for @u2 } | ||
| 176 | + it { project_hooks_path(@project).should be_denied_for :user } | ||
| 177 | + it { project_hooks_path(@project).should be_denied_for :visitor } | ||
| 178 | + end | ||
| 179 | + | ||
| 180 | + describe "GET /project_code/files" do | ||
| 181 | + it { files_project_path(@project).should be_allowed_for @u1 } | ||
| 182 | + it { files_project_path(@project).should be_allowed_for @u3 } | ||
| 183 | + it { files_project_path(@project).should be_denied_for :admin } | ||
| 184 | + it { files_project_path(@project).should be_denied_for @u2 } | ||
| 185 | + it { files_project_path(@project).should be_denied_for :user } | ||
| 186 | + it { files_project_path(@project).should be_denied_for :visitor } | ||
| 187 | + end | ||
| 143 | end | 188 | end |
| 144 | end | 189 | end |
spec/requests/tags_spec.rb
| @@ -1,27 +0,0 @@ | @@ -1,27 +0,0 @@ | ||
| 1 | -require 'spec_helper' | ||
| 2 | - | ||
| 3 | -describe "Tags" do | ||
| 4 | - before { login_as :user } | ||
| 5 | - | ||
| 6 | - # describe "GET 'tags/index'" do | ||
| 7 | - # it "should be successful" do | ||
| 8 | - # get 'tags/index' | ||
| 9 | - # response.should be_success | ||
| 10 | - # end | ||
| 11 | - # end | ||
| 12 | - | ||
| 13 | - describe "GET '/tags.json'" do | ||
| 14 | - before do | ||
| 15 | - @project = Factory :project | ||
| 16 | - @project.add_access(@user, :read) | ||
| 17 | - @project.tag_list = 'demo1' | ||
| 18 | - @project.save | ||
| 19 | - visit '/tags.json' | ||
| 20 | - end | ||
| 21 | - | ||
| 22 | - it "should contains tags" do | ||
| 23 | - page.should have_content('demo1') | ||
| 24 | - end | ||
| 25 | -end | ||
| 26 | - | ||
| 27 | -end |
spec/requests/team_members_spec.rb
| @@ -18,7 +18,7 @@ describe "TeamMembers" do | @@ -18,7 +18,7 @@ describe "TeamMembers" do | ||
| 18 | end | 18 | end |
| 19 | end | 19 | end |
| 20 | 20 | ||
| 21 | - describe "New Team member", :js => true do | 21 | + describe "New Team member" do |
| 22 | before do | 22 | before do |
| 23 | @user_1 = Factory :user | 23 | @user_1 = Factory :user |
| 24 | visit team_project_path(@project) | 24 | visit team_project_path(@project) |