Hello,
I'm new in using RSpec and I can't figured out to spec this controller
action.
class OrdersController < ApplicationController
before_filter :authenticate_user!
def index
respond_with(@orders = current_user.orders)
end
end
When I want to spec this "@assets = Asset.all" I use "As
der])
undefined local variable or method `current_user' for
#
On 26 août, 15:28, David Chelimsky wrote:
> On Aug 24, 2010, at 6:51 PM, Titinux wrote:
>
>
>
> > Hello,
>
> > I'm new in using RSpec and I can't figured out to spec this controller
> > a
Hello,
I'm using Rails 3.1.3 with rspec-rails 2.8.1. I have a scope ':locale'
in routes.rb and I want to run controller and routing
specs. I'm aware of the problem with setting default_url_options in
application.rb controller so I apply the solution found in the last
comment on rspec issue #255 (
ale=>:en}
ActionDispatch::Routing::RouteSet.new.default_url_options =>
{:locale=>:en}
So I think the patch does its job but "get :index" takes another path
and not use default_url_options from
ActionView::TestCase::TestController nor
ActionDispatch::Routing::RouteSet
On 17 jan, 02:18, David Chelimsky