A bit of spinach tests
This commit is contained in:
parent
ab344f31b6
commit
2f6603e581
11 changed files with 116 additions and 95 deletions
|
@ -3,59 +3,6 @@ require 'spec_helper'
|
|||
describe "Projects" do
|
||||
before { login_as :user }
|
||||
|
||||
describe "GET /projects/show" do
|
||||
before do
|
||||
@project = create(:project, namespace: @user.namespace)
|
||||
@project.team << [@user, :reporter]
|
||||
|
||||
visit project_path(@project)
|
||||
end
|
||||
|
||||
it "should be correct path" do
|
||||
current_path.should == project_path(@project)
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET /projects/:id/edit" do
|
||||
before do
|
||||
@project = create(:project)
|
||||
@project.team << [@user, :master]
|
||||
|
||||
visit edit_project_path(@project)
|
||||
end
|
||||
|
||||
it "should be correct path" do
|
||||
current_path.should == edit_project_path(@project)
|
||||
end
|
||||
|
||||
it "should have labels for new project" do
|
||||
page.should have_content("Project name is")
|
||||
page.should have_content("Advanced settings:")
|
||||
page.should have_content("Features:")
|
||||
end
|
||||
end
|
||||
|
||||
describe "PUT /projects/:id" do
|
||||
before do
|
||||
@project = create(:project, namespace: @user.namespace)
|
||||
@project.team << [@user, :master]
|
||||
|
||||
visit edit_project_path(@project)
|
||||
|
||||
fill_in 'project_name', with: 'Awesome'
|
||||
click_button "Save"
|
||||
@project = @project.reload
|
||||
end
|
||||
|
||||
it "should be correct path" do
|
||||
current_path.should == edit_project_path(@project)
|
||||
end
|
||||
|
||||
it "should show project" do
|
||||
page.should have_content("Awesome")
|
||||
end
|
||||
end
|
||||
|
||||
describe "DELETE /projects/:id" do
|
||||
before do
|
||||
@project = create(:project, namespace: @user.namespace)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue