I've solved it.
First, I'm using Devise and, according to Devise
docs<https://github.com/plataformatec/devise/wiki/How-To:-Controllers-and-Views-tests-with-Rails-3-(and-rspec)>,
I should add to test/test_helper.rb something like:
class ActionController::TestCase
include Devise::TestHelpers
def sign_in_user
@request.env["devise.mapping"] = Devise.mappings[:user]
sign_in users(:first_user)
end
end
And add add_user call in test/functional/addresses_controller_test.rb in
setup macro:
setup |do|
sign_in_user
@user = users(:first_user)
end
Second, next things different between default rails scaffolds and Active
Scaffold:
- You should pass record hash in post request instead of model_name
- create and update actions redirects to index
- Active Scaffold do not assign instance variables such as @model_names (as
generated tests asserts for)
Moreover, if you have disabled some actions (e.g. show, test for them
should be removed or asserting for raising ActionView::Template::Error)
After that changes, I've get these tests passed. Thanks and sorry for
inconvenience.
--
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/activescaffold/-/UyBeRmnYLwoJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en.