From 9cd1069a8c0c9193c5867d12419eb5b9852f6411 Mon Sep 17 00:00:00 2001 From: randx Date: Sun, 27 May 2012 13:39:57 +0300 Subject: [PATCH] [Tests] Better project coverage --- spec/monkeypatch.rb | 2 +- spec/requests/projects_spec.rb | 44 ++++++++++++++++++++-------------- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/spec/monkeypatch.rb b/spec/monkeypatch.rb index b4c358c2..6133631c 100644 --- a/spec/monkeypatch.rb +++ b/spec/monkeypatch.rb @@ -5,7 +5,7 @@ class Project true end - def update_repository + def destroy_repository true end diff --git a/spec/requests/projects_spec.rb b/spec/requests/projects_spec.rb index dd7d040c..d35982e2 100644 --- a/spec/requests/projects_spec.rb +++ b/spec/requests/projects_spec.rb @@ -75,15 +75,23 @@ describe "Projects" do it "should be correct path" do current_path.should == project_path(@project) end + end - # TODO: replace with real one - #it "should beahave like activities page" do - #within ".project-update" do - #page.should have_content("master") - #page.should have_content(@project.commit.author.name) - #page.should have_content(@project.commit.safe_message) - #end - #end + describe "GET /projects/graph" do + before do + @project = Factory :project, :path => "gitlab_remove" + @project.add_access(@user, :read) + + visit graph_project_path(@project) + end + + it "should be correct path" do + current_path.should == graph_project_path(@project) + end + + it "should have as as team member" do + page.should have_content("master") + end end describe "GET /projects/team" do @@ -146,15 +154,15 @@ describe "Projects" do end end - #describe "DELETE /projects/:id", :js => true do - #before do - #@project = Factory :project - #@project.add_access(@user, :read, :admin) - #visit projects_path - #end + describe "DELETE /projects/:id" do + before do + @project = Factory :project + @project.add_access(@user, :read, :admin) + visit edit_project_path(@project) + end - #it "should be correct path" do - #expect { click_link "Destroy" }.to change {Project.count}.by(1) - #end - #end + it "should be correct path" do + expect { click_link "Remove" }.to change {Project.count}.by(-1) + end + end end