rspec
How to set "programmatically"\"iteratively" each class object attribute to a value?
I am using Ruby on Rails 3.0.9 and RSpec 2. I am trying to refactoring some spec file in the following way (in order to test with less code similar class object attribute values):[详细]
2023-04-06 04:07 分类:问答Trouble on evaluating other model data
I am using Ruby on Rails 3.0.9 and RSpec 2. In my spec file I have code like the following: describe User do[详细]
2023-04-06 02:37 分类:问答How to test if a method is called on an object - Rails RSpec
I have two开发者_C百科 models, Foo and Bar. Foo has a method called ask_bar_to_do_something, which is called after an instance of Foo is saved. This method does not change state of this Foo instance.[详细]
2023-04-06 02:31 分类:问答Why is my conditional validation failing?
I have a conditional validation in my Post model: validates :title, :presence => true, :if => Proc.new { |post| post.post_type == \"text\" }[详细]
2023-04-06 01:59 分类:问答Stubbing the Capybara session for a page object test
I\'m using Cucumber with a page object similar to the simplified version shown below. I need to do some quite complex parsing of the HTML, so I\'d like to be able to unit test the page object in isola[详细]
2023-04-06 01:44 分类:问答rspec controller test with devise authentication
I am having problem with rspec testing controller the devise authentication. I have a following setup I have included[详细]
2023-04-06 00:29 分类:问答rspec / rake issue - Rake::DSL global methods are clobbering my model somehow
I\'m working through the upgrade to 3.1, and hit a snag. I have a model (using Mongoid) that is having it\'s \'link\' method overwritten by Rake, apparently.I\'m getting this message:[详细]
2023-04-06 00:25 分类:问答Testing Rails 3.1 mountable engine with Rspec
I started making a Rails 3.1 engine, and I\'m having a hard time testing it using rspec. First of all, if I run rails g integration_test whatever it creates a regular integration test in tests/integr[详细]
2023-04-06 00:24 分类:问答Specifying a query string in rspec
I\'m integratin开发者_Go百科g with a 3rd party library that validates the query string with a hash (requiring that the order of the query string be preserved). Is there a way to pass a query string li[详细]
2023-04-05 23:59 分类:问答Cucumber and Rspec sharing factory girl factories
I\'m designing a test around rails using Cucumber and Rspec and I was 开发者_运维技巧wondering if it is good practice sharing the Factory Girl factory code between the Cucumber acceptance test and Rsp[详细]
2023-04-05 19:39 分类:问答