Commit 9cd1069a8c0c9193c5867d12419eb5b9852f6411

Authored by randx
1 parent baa54629

[Tests] Better project coverage

spec/monkeypatch.rb
@@ -5,7 +5,7 @@ class Project @@ -5,7 +5,7 @@ class Project
5 true 5 true
6 end 6 end
7 7
8 - def update_repository 8 + def destroy_repository
9 true 9 true
10 end 10 end
11 11
spec/requests/projects_spec.rb
@@ -75,15 +75,23 @@ describe "Projects" do @@ -75,15 +75,23 @@ describe "Projects" do
75 it "should be correct path" do 75 it "should be correct path" do
76 current_path.should == project_path(@project) 76 current_path.should == project_path(@project)
77 end 77 end
  78 + end
  79 +
  80 + describe "GET /projects/graph" do
  81 + before do
  82 + @project = Factory :project, :path => "gitlab_remove"
  83 + @project.add_access(@user, :read)
  84 +
  85 + visit graph_project_path(@project)
  86 + end
78 87
79 - # TODO: replace with real one  
80 - #it "should beahave like activities page" do  
81 - #within ".project-update" do  
82 - #page.should have_content("master")  
83 - #page.should have_content(@project.commit.author.name)  
84 - #page.should have_content(@project.commit.safe_message)  
85 - #end  
86 - #end 88 + it "should be correct path" do
  89 + current_path.should == graph_project_path(@project)
  90 + end
  91 +
  92 + it "should have as as team member" do
  93 + page.should have_content("master")
  94 + end
87 end 95 end
88 96
89 describe "GET /projects/team" do 97 describe "GET /projects/team" do
@@ -146,15 +154,15 @@ describe "Projects" do @@ -146,15 +154,15 @@ describe "Projects" do
146 end 154 end
147 end 155 end
148 156
149 - #describe "DELETE /projects/:id", :js => true do  
150 - #before do  
151 - #@project = Factory :project  
152 - #@project.add_access(@user, :read, :admin)  
153 - #visit projects_path  
154 - #end  
155 -  
156 - #it "should be correct path" do  
157 - #expect { click_link "Destroy" }.to change {Project.count}.by(1)  
158 - #end  
159 - #end 157 + describe "DELETE /projects/:id" do
  158 + before do
  159 + @project = Factory :project
  160 + @project.add_access(@user, :read, :admin)
  161 + visit edit_project_path(@project)
  162 + end
  163 +
  164 + it "should be correct path" do
  165 + expect { click_link "Remove" }.to change {Project.count}.by(-1)
  166 + end
  167 + end
160 end 168 end