I am trying an rspec test where the example looks like so: it \"cannot be deleted if it has children\" do
Than开发者_开发百科 request.env[\'RAW_POST_DATA\'] = json_body?I\'m not sure if this is what you mean, but you can set the request headers to indicate JSON:
I have these validations : it \"should have 100 adventure points\" do user = User.new user.adventure_points.should == 100
Noob who may be missing something obvio开发者_如何转开发us ... I\'m trying to debug an Rspec file.The Rspec file is stripped down at this point:
When developing gems in Ruby, I almost always need a file in which I can configure RSpec to my needs and maybe before doing that, require some helper modules which should be available开发者_运维知识库
I have a rails app, that is setup with the d开发者_JAVA技巧efault test unit, how can I remove it and use rspec instead?(I don\'t have any tests written, I just didn\'t ignore it during app generation)
I think there\'s a way to run only tests with a given 开发者_StackOverflow社区label. Anybody know?You can tag examples with :focus hash attribute. For example,
Anyone have any tips on how to test an rss feed with cucumber (preference) or rspec? Note, I am currently working on a Rails 3 application with a blog which I expose as an rss feed.
I was trying to test a simple index view, which has following code inside: - if can? :destroy, MyModel
When my specs hit an error, I get a message like this: Vendor should reject duplicate names Failure/Error: user_with_duplicate_email.should_not be_valid