Fixed some tests and snippet colorize

This commit is contained in:
Dmitriy Zaporozhets 2012-11-23 22:31:09 +03:00
parent 470aa7675e
commit 9304d049de
13 changed files with 64 additions and 68 deletions

View file

@ -2,9 +2,7 @@ require 'spec_helper'
describe "Admin::Projects" do
before do
@project = create(:project,
name: "LeGiT",
code: "LGT")
@project = create(:project)
login_as :admin
end
@ -29,7 +27,7 @@ describe "Admin::Projects" do
end
it "should have project info" do
page.should have_content(@project.code)
page.should have_content(@project.path)
page.should have_content(@project.name)
end
end
@ -48,19 +46,16 @@ describe "Admin::Projects" do
describe "Update project" do
before do
fill_in "project_name", with: "Big Bang"
fill_in "project_code", with: "BB1"
click_button "Save Project"
@project.reload
end
it "should show page with new data" do
page.should have_content("BB1")
page.should have_content("Big Bang")
end
it "should change project entry" do
@project.name.should == "Big Bang"
@project.code.should == "BB1"
end
end
end
@ -77,8 +72,6 @@ describe "Admin::Projects" do
it "should have labels for new project" do
page.should have_content("Project name is")
page.should have_content("Git Clone")
page.should have_content("URL")
end
end
@ -86,8 +79,6 @@ describe "Admin::Projects" do
before do
visit new_admin_project_path
fill_in 'project_name', with: 'NewProject'
fill_in 'project_code', with: 'NPR'
fill_in 'project_path', with: 'gitlabhq_1'
expect { click_button "Create project" }.to change { Project.count }.by(1)
@project = Project.last
end