2011-12-31 11:52:01 +01:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe "Repository" do
|
|
|
|
|
|
|
|
before do
|
|
|
|
@user = Factory :user
|
|
|
|
@project = Factory :project
|
|
|
|
@project.add_access(@user, :read, :write)
|
|
|
|
login_with @user
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "GET /:project_name/repository" do
|
|
|
|
before do
|
|
|
|
visit project_repository_path(@project)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should be on projects page" do
|
|
|
|
current_path.should == project_repository_path(@project)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should have link to repo activities" do
|
|
|
|
page.should have_content("Activities")
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should have link to last commit for activities tab" do
|
|
|
|
page.should have_content(@project.commit.safe_message[0..20])
|
|
|
|
page.should have_content(@project.commit.author_name)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should show commits list" do
|
2012-01-04 21:19:41 +01:00
|
|
|
page.all(:css, ".project-update").size.should == @project.repo.branches.size
|
2011-12-31 11:52:01 +01:00
|
|
|
end
|
|
|
|
end
|
2011-12-31 12:12:10 +01:00
|
|
|
|
|
|
|
describe "GET /:project_name/repository/branches" do
|
|
|
|
before do
|
|
|
|
visit branches_project_repository_path(@project)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should have link to repo activities" do
|
|
|
|
page.should have_content("Branches")
|
|
|
|
page.should have_content("master")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# TODO: Add new repo to seeds with tags list
|
|
|
|
describe "GET /:project_name/repository/tags" do
|
|
|
|
before do
|
|
|
|
visit tags_project_repository_path(@project)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should have link to repo activities" do
|
|
|
|
page.should have_content("Tags")
|
|
|
|
page.should have_content("No tags")
|
|
|
|
end
|
|
|
|
end
|
2011-12-31 11:52:01 +01:00
|
|
|
end
|
|
|
|
|