dashboard_spec.rb
943 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
require 'spec_helper'
describe "User Dashboard" do
before { login_as :user }
describe "GET /" do
before do
@project = Factory :project, :owner => @user
@project.add_access(@user, :read)
visit dashboard_path
end
it "should be on projects page" do
current_path.should == dashboard_path
end
it "should have link to new project" do
page.should have_content("New Project")
end
it "should have project" do
page.should have_content(@project.name)
end
it "should render projects atom feed via private token" do
logout
visit dashboard_path(:atom, :private_token => @user.private_token)
page.body.should have_selector("feed title")
end
it "should not render projects page via private token" do
logout
visit dashboard_path(:private_token => @user.private_token)
current_path.should == new_user_session_path
end
end
end