2011-10-08 23:36:38 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe "Commits" do
|
|
|
|
let(:project) { Factory :project }
|
|
|
|
let!(:commit) { project.repo.commits.first }
|
2011-10-26 15:46:25 +02:00
|
|
|
before do
|
2011-10-08 23:36:38 +02:00
|
|
|
login_as :user
|
|
|
|
project.add_access(@user, :read)
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "GET /commits" do
|
2011-10-26 15:46:25 +02:00
|
|
|
before do
|
2011-10-08 23:36:38 +02:00
|
|
|
visit project_commits_path(project)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should have valid path" do
|
|
|
|
current_path.should == project_commits_path(project)
|
|
|
|
end
|
|
|
|
|
2011-10-26 15:46:25 +02:00
|
|
|
it "should have project name" do
|
2011-10-08 23:36:38 +02:00
|
|
|
page.should have_content(project.name)
|
|
|
|
end
|
|
|
|
|
2011-10-26 15:46:25 +02:00
|
|
|
it "should list commits" do
|
2011-10-08 23:36:38 +02:00
|
|
|
page.should have_content(commit.author)
|
|
|
|
page.should have_content(commit.message)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-10-26 15:46:25 +02:00
|
|
|
describe "GET /commits/:id" do
|
|
|
|
before do
|
2011-10-08 23:36:38 +02:00
|
|
|
visit project_commit_path(project, commit)
|
|
|
|
end
|
|
|
|
|
2011-10-26 15:46:25 +02:00
|
|
|
it "should have valid path" do
|
2011-10-08 23:36:38 +02:00
|
|
|
current_path.should == project_commit_path(project, commit)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|