I have seen both styles used widely: #1 lambda {开发者_JS百科 raise \"Boom\" }.should raise_error and #2 expect { raise \"Boom\" }.to raise_error. I like expect..to more as it reads better and hides t
I am new to rails and this is stopping me. I am trying to run rspec spec/ and I get errors.Can anyone help me?
I can I check if FeedItem::populate_from_friend_to_user is called inside the user class? 开发者_运维问答it \"should auto populate feed after user.add_friend\" do
I\'m using Rails 3.0.1, RSpec-Rails 2.0.1 and Webrat 0.7.1.I have the following test: describ开发者_JAVA百科e PagesController do
How to assert the multiline string with RSpec? I\'ve something like below as expectation: it \"should generate the correct header for the xml file\" do
I have a nested resource, setup like this: resources :chickens do resources :eggs end The views for the EggsController are under views/eggs, but:
I\'m using Rails 3 / factory_girl_rails / Rspec 2 and Ruby 1.8 I\'ve defined my factories this way: Factory.define :user do |u|
I\'m l开发者_JAVA技巧earning RSpec 2 with Rails 3. In order to set the contents of thetag in the layout for each page, I have a helper that can be used to set the title and then return it:
I know rake spec:models to spec all models. Is there a way to spec only one model, or only a given collection of models?
I\'m trying to generate an easy macro for a Rails app that uses Devise for authentication.Basically I want to ensure that when a user accesses a page that requires authentication, they\'re redirected