2011-10-09 00:36:38 +03:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe "Admin::Projects" do
|
2011-10-26 18:46:25 +05:00
|
|
|
before do
|
2012-11-23 22:31:09 +03:00
|
|
|
@project = create(:project)
|
2011-10-09 00:36:38 +03:00
|
|
|
login_as :admin
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "GET /admin/projects" do
|
2011-10-26 18:46:25 +05:00
|
|
|
before do
|
2011-10-09 00:36:38 +03:00
|
|
|
visit admin_projects_path
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should be ok" do
|
|
|
|
current_path.should == admin_projects_path
|
|
|
|
end
|
|
|
|
|
2011-10-26 18:46:25 +05:00
|
|
|
it "should have projects list" do
|
2011-10-09 00:36:38 +03:00
|
|
|
page.should have_content(@project.name)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-10-26 18:46:25 +05:00
|
|
|
describe "GET /admin/projects/:id" do
|
|
|
|
before do
|
2011-10-09 00:36:38 +03:00
|
|
|
visit admin_projects_path
|
2011-11-22 15:55:01 +08:00
|
|
|
click_link "#{@project.name}"
|
2011-10-09 00:36:38 +03:00
|
|
|
end
|
|
|
|
|
2011-10-26 18:46:25 +05:00
|
|
|
it "should have project info" do
|
2012-11-23 22:31:09 +03:00
|
|
|
page.should have_content(@project.path)
|
2011-10-09 00:36:38 +03:00
|
|
|
page.should have_content(@project.name)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|