2011-10-08 17:36:38 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe "Projects", "Wall" do
|
|
|
|
let(:project) { Factory :project }
|
|
|
|
|
2011-10-26 09:46:25 -04:00
|
|
|
before do
|
2011-10-08 17:36:38 -04:00
|
|
|
login_as :user
|
|
|
|
project.add_access(@user, :read, :write)
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "View notes on wall" do
|
2011-10-26 09:46:25 -04:00
|
|
|
before do
|
2011-10-08 17:36:38 -04:00
|
|
|
Factory :note, :project => project, :note => "Project specs", :author => @user
|
|
|
|
visit wall_project_path(project)
|
|
|
|
end
|
|
|
|
|
|
|
|
it { page.should have_content("Project specs") }
|
|
|
|
it { page.should have_content(@user.name) }
|
|
|
|
it { page.should have_content("less than a minute ago") }
|
|
|
|
end
|
|
|
|
|
2011-10-26 09:46:25 -04:00
|
|
|
describe "add new note", :js => true do
|
|
|
|
before do
|
2011-10-08 17:36:38 -04:00
|
|
|
visit wall_project_path(project)
|
|
|
|
fill_in "note_note", :with => "my post on wall"
|
|
|
|
click_button "Add note"
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should conatin new note" do
|
|
|
|
page.should have_content("my post on wall")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|