rspec2
Using RSpec2 to test a controller's show action
I have a fairly simple Rails 3 project where I\'ve defined a custom route: get \'factions/:name\' => \'factions#show\', :as => :factions[详细]
2023-03-10 22:53 分类:问答Testing "HTML fixtures" with RSpec and rails
I have a web scraper built to parse html from a website and I\'m trying to write tests for it. The class I\'m trying to test receives a Nokogiri HTML object and extracts the required data from it. No[详细]
2023-03-10 06:38 分类:问答Rspec 2 config :type types
In my spec_helper.rb I have config.include Devise::TestHelpers, :type => :controller so that I can actually test my controllers that require the user to be authenticated. However, the spec for t[详细]
2023-03-10 02:41 分类:问答Mocking a non database backed model in Rails with Rspec
I am trying to create a non ActiveRecord model in my Ruby on Rails application according to http://railscasts.com/episodes/121-non-active-record-model. I am facing hard time testing it though.[详细]
2023-03-09 11:25 分类:问答Dynamically generating shared examples in RSpec 2?
I\'m trying to keep my specs DRY by creating a shared example group that performs the boilerplate checks for all admin controllers (all controllers under the Admin namespace of my project).I\'m strugg[详细]
2023-03-09 05:14 分类:问答How do you test code that forks using rspec
I have the following开发者_Python百科 code def start_sunspot_server unless @server pid = fork do STDERR.reopen(\"/dev/null\")[详细]
2023-03-09 02:22 分类:问答select specific link by href with webrat
I\'m writing an integration test for rspec and I want to te开发者_如何转开发st that clicking on a link goes to the correct model page. More specifically, I want to test this on a list of links that ha[详细]
2023-03-08 09:16 分类:问答rails3, rspec2 ActiveRecord#changes error in specs
I\'m upgrading my rails 2 app to rails 3. I use rspec, shoulda and factory girl in the test suite. One particular pattern is causing an error I\'m having a really hard time both researching and solvi[详细]
2023-03-07 06:47 分类:问答Ssetting up rspec2 task in Rakefile
I have a Rakefile that looks like this: require \'rspec/core/rake_task\' desc \"Run all RSpec tests\" RSpec::Core::RakeTask.new(:spec)[详细]
2023-03-07 04:51 分类:问答Rspec testing redirect_to :back
How do you test redirect_to :back in rspec? I get ActionController::RedirectBackError: No HTTP_REFERER was set in the request to this action, so redirect_to :back could not be called successfully.[详细]
2023-03-07 02:51 分类:问答