[rspec-users] Strange mock_model behaviour with ActiveResource model
bryansray at gmail.com
Fri Oct 12 20:01:41 EDT 2007
Can you post your entire:
it "should assign the found fa_codes for the view" block? as well as
your fa_code controller? perhaps pastie it and link.
That appears to be the spec failing.
James Hughes wrote:
> I have two models in an app that inherit from ActiveResource::Base.
> The scaffold controller tests for one of the models works fine, but
> the other one dies when calling mock_model in the "handling GET
> /fa_codes" spec:
> Specifically, the call to mock model here:
> before do
> @fa_code = mock_model(FaCode)
> generates this failure:
> NameError in 'FaCodesController handling GET /fa_codes should assign
> the found fa_codes for the view'
> uninitialized constant Spec::Rails::Initializer
> (eval):11:in `class'
> This is with edge rails, trunk rspec and rspec_on_rails. I might have
> pegged this as some Ares wierdness, but there are two models with the
> same setup, and only one dies like this.
> Any ideas?
> rspec-users mailing list
> rspec-users at rubyforge.org
More information about the rspec-users