diff options
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/general_controller_spec.rb | 26 | ||||
-rw-r--r-- | spec/controllers/request_controller_spec.rb | 25 | ||||
-rw-r--r-- | spec/controllers/user_controller_spec.rb | 2 |
3 files changed, 28 insertions, 25 deletions
diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb new file mode 100644 index 000000000..ab2a0eb60 --- /dev/null +++ b/spec/controllers/general_controller_spec.rb @@ -0,0 +1,26 @@ +require File.dirname(__FILE__) + '/../spec_helper' + +describe GeneralController, "when showing the front page" do + integrate_views + fixtures :users + + it "should be successful" do + get :frontpage + response.should be_success + end + + it "should have sign in/up link when not signed in" do + get :frontpage + response.should have_tag('a', "Sign in or sign up") + end + + it "should have sign out link when signed in" do + session[:user_id] = users(:bob_smith_user).id + get :frontpage + response.should have_tag('a', "Sign out") + end + + +end + + diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index 4d68c2b8c..d8a0466ba 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -1,28 +1,5 @@ require File.dirname(__FILE__) + '/../spec_helper' -describe RequestController, "when showing the front page" do - integrate_views - fixtures :users - - it "should be successful" do - get :frontpage - response.should be_success - end - - it "should have sign in/up link when not signed in" do - get :frontpage - response.should have_tag('a', "Sign in or sign up") - end - - it "should have sign out link when signed in" do - session[:user_id] = users(:bob_smith_user).id - get :frontpage - response.should have_tag('a', "Sign out") - end - - -end - describe RequestController, "when listing all requests" do integrate_views fixtures :info_requests, :outgoing_messages @@ -91,7 +68,7 @@ describe RequestController, "when creating a new request" do it "should redirect to front page if no public body specified" do get :new - response.should redirect_to(:action => 'frontpage') + response.should redirect_to(:controller => 'general', :action => 'frontpage') end it "should accept a public body parameter posted from the front page" do diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb index cf82ccfb7..66f883ef3 100644 --- a/spec/controllers/user_controller_spec.rb +++ b/spec/controllers/user_controller_spec.rb @@ -153,7 +153,7 @@ describe UserController, "when signing out" do session[:user_id] = users(:bob_smith_user).id get :signout session[:user_id].should be_nil - response.should redirect_to(:controller => 'request', :action => 'frontpage') + response.should redirect_to(:controller => 'general', :action => 'frontpage') end it "should log you out and redirect you to where you were" do |