Displaying 7 results from an estimated 7 matches for "application_controller_spec".
2007 May 24
25
Specs for ApplicationController, where to put them?
The Rails ApplicationController (app/controllers/application.rb)
serves as an abstract superclass for all other controllers in a Rails
application and is a good place to put methods and filters which you
want all of your controllers to use. In my case I''m using it to
provide methods such as "current_user" and "logged_in?" etc.
By default, RSpec
2007 Dec 12
3
undefined method: controller_name
With rspec 1.0.8 I have a spec in the directory:
spec/units/controllers/application_controller_spec.rb
require File.dirname(__FILE__) + ''/../../spec_helper''
class DummyController < ApplicationController
def index
raise "Prevent index from rendering"
end
end
describe ApplicationController, "Handling errors in production",
:behaviour_type => :...
2007 Dec 04
1
spec''ing shared controller methods
...ionController::Base
...
def find_account
@account = Account.find_by_id( params[:account_id])
# TODO: check account status is suspended, closed, different
flash message?
return( error_redirect_gracefully( "Account not found")) unless
@account
end
...
end
## application_controller_spec.rb
require File.dirname(__FILE__) + ''/../spec_helper''
ActionController::Routing::Routes.draw do |map|
map.connect ''foos/:action'', :controller => ''foos''
end
class FoosController < ApplicationController
end
describe FoosController, &q...
2007 Mar 19
0
cookies
...rollers (via ApplicationController)...
{"auth_token"=>42}
- should allow access to url with proper cookie (FAILED - 1)
1) ''All controllers (via ApplicationController)... should see cookie'' FAILED
expected 42, got "NOT seen!" (using .eql?)
./spec/controllers/application_controller_spec.rb:17:
Finished in 0.143717 seconds
1 specification, 1 failure
Is it something to do with
http://www.40withegg.com/2007/1/5/rails-cookies-mangles-the-hash-interface
and if so, is there a workaround?
Many thanks,
Jerry
2007 Oct 05
0
RSpec Trunk - Successful : Rake Aborted
...c/acceptance/ng7_spec.rb"
"spec/acceptance/ng61_spec.rb"
"spec/acceptance/ng65_assign_user_to_user_group_spec.rb"
"spec/acceptance/ng4_spec.rb"
"spec/acceptance/ng68_player_container_spec.rb"
"spec/acceptance/ng6_spec.rb"
"spec/controllers/application_controller_spec.rb"
"spec/controllers/roles_controller_spec.rb"
"spec/controllers/ng2_acceptance_spec.rb"
"spec/controllers/permissions_roles_controller_spec.rb"
"spec/controllers/player_containers_controller_spec.rb"
"spec/controllers/user_groups_controller_spec.r...
2007 Oct 16
6
Failure trying to test ApplicationController
I''m trying to write some tests for the ApplicationController as shared
tests that can be run in all of my other controller tests, but am getting
a nil.rewrite error. Below is what I have...
describe AccountController do
it_should_behave_like ''Application controller''
end
describe ''Application controller'', :shared => true do
it
2008 Jun 28
19
Stopping example execution?
Hello, I''m wondering If I am missing something here when creating an example that sets an expecation at the top or beginning of an action but requires you to stub / mock everything that follows.
Example:
I want to test that a certain controller is running a before_filter...thats easy:
- controller.should_receive(:require_user)
- do_get
But now i''ve got to mock / stub