Hi,
I am a new comer of testing on rails .
I am trying to testing my controller, and read a lot of testing using rspec
and shoulda.
can anyone give me some examples about those rspec.
cuz sometime i did not understand how to use rspec for the controller.
def create
@user = User.new(params[:user])
@user.is_admin = false
@user.enabled = false
if @user.save
redirect_to :action => "confirm"
else
@cultures = Culture.where(:enabled => true)
@languages = Language.where(:enabled => true)
render "new"
end
end
def show
redirect_to :action => "edit"
end
if my controller like that.. how can i test by using rspec.. please help
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/d2DUAY7ZAh0J.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.