Top "Rspec" questions

RSpec is a behavior-driven development (BDD) framework for the Ruby programming language, inspired by JBehave.

How do you run a single test/spec file in RSpec?

I want to be able to run a single spec file's tests — for the one file I'm editing, for example. …

ruby testing rspec
How to run a single RSpec test?

I have the following file: /spec/controllers/groups_controller_spec.rb What command in terminal do I use to run …

ruby-on-rails ruby ruby-on-rails-3 rspec
How to check for a JSON response using RSpec?

I have the following code in my controller: format.json { render :json => { :flashcard => @flashcard, :lesson => @lesson, :success =&…

ruby-on-rails json rspec
RSpec: how to test if a method was called?

When writing RSpec tests, I find myself writing a lot of code that looks like this in order to ensure …

ruby-on-rails ruby rspec
When to use RSpec let()?

I tend to use before blocks to set instance variables. I then use those variables across my examples. I recently …

ruby rspec
Rails: Missing host to link to! Please provide :host parameter or set default_url_options[:host]

I have been googling for about 90 minutes now and still don't have an answer to this. Where do I set …

ruby-on-rails rspec
How to get Rails.logger printing to the console/stdout when running rspec?

Same as title: How to get Rails.logger printing to the console/stdout when running rspec? Eg. Rails.logger.info "…

ruby-on-rails logging rspec console stdout
How do I prepare test database(s) for Rails rspec tests without running rake spec?

After significant troubleshooting, I figured out that I needed to run rake spec once (I can abort with control-c) before …

ruby-on-rails ruby-on-rails-3 rspec rspec2 specjour
How to check a checkbox in capybara?

I'm using Rspec and Capybara. How can I write a step to check a checkbox? I've tried check by value …

ruby-on-rails ruby testing rspec capybara
Generate a controller with all the RESTful functions

I am trying to generate a controller with all the RESTful actions stubbed. I had read at Wikibooks - Ruby …

ruby-on-rails controller rest rspec