Hello everyone,
I have been using rspec with webrat and decided to add cucumber for high level tests.
After installing cucumber with capybara, for some reason rspec also switched to using it.
Is there a way to tell rspec to continue using webrat ?
...
I gave Rails3 a try and to do so I installed the new gems, like RSpec2. When I went back to my old apps though, autospec stopped working for Rails 2.3.x apps:
$ AUTOFEATURE=true autospec
/usr/local/lib/site_ruby/1.8/rubygems.rb:335:in `bin_path': can't find executable autospec for rspec-2.0.1 (Gem::Exception)
from /usr/bin/autospec...
Hey,
Im using rspec and when i run rake spec, the user mailer sends email through smtp and not stores the email in the ActionMailer::Base.deliveries-array (invoked by an user-observer)...
Could you give me a hint why?
# Rails version
rails -v
=> Rails 3.0.1
# Ruby version with rvm (rvm version 1.0.16)
ruby -v
=> ruby 1.9.2p7 (2010-09...
I'm learning RSpec 2 with Rails 3. In order to set the contents of the tag in the layout for each page, I have a helper that can be used to set the title and then return it:
def page_title(subtitle=nil)
if @title.nil?
@title = ["Site Name"]
end
unless subtitle.nil?
@title << subtitle
end
@title.reverse.join " - "
en...
This question is regarding the html form in RSpec book (beta version b15_0), page: 301.
The best way I could figure for that problem is this:
<p>
<%= f.label :genres %><br />
<%- @genres.each do |genre| %>
<%= check_box_tag(genre.name, genre.id) %>
<%= label_tag(genre.name) %><br />
<%- end %>
</p>
This forces me to chec...
Trying to test a controller in Rspec. (Rails 2.3.8, Ruby 1.8.7, Rspec 1.3.1, Rspec-Rails 1.3.3)
I'm trying to post a create but I get this error message:
ActiveRecord::AssociationTypeMismatch in 'ProjectsController with appropriate parameters while logged in: should create project'
User(#2171994580) expected, got TrueClass(#214825...
I have not gotten any errors with the tests up to this point so far, but I can't figure out these errors.
Failures:
1) PagesController GET 'home' should have the right title
Failure/Error: response.should have_selector("title",
undefined method `has_selector?' for #<ActionController::TestResponse:0x00000100ee9ed0>
#...
I have a spec which is failing because of this:
unexpected invocation:
#<AnyInstance:Achievement(id: integer, name: string, created_at: datetime, updated_at: datetime)>.errors()
satisfied expectations:
#<AnyInstance:Achievement(id: integer, name: string, created_at: datetime, updated_at: datetime)>.errors(any_parameters)
In my spec I...
Hello.
I have a nested controller that works fine, and I'd like to setup rspec to also test a nested controlled, but it doesn't test the controller unless I specify it.
i.e. my rspec test controller is here:
/spec/controllers/organizations/memberships_controller.rb
but when I run rspec to test everything, it tests everything except th...
I find the integration with RSpec, Growl and rails particularly useful. However, it takes about two to three seconds before a change (save file) is picked up by autotest.
Is there a way to increase the interval by which autotest scans for filechanges?
...
I have a scenario outline with multiple scenarios. I'd like my Before hook to run only once so I can bootstrap the ActiveRecord objects I need to run against all of the scenarios. The problem is if I use
Before do
# my code here
end
This will execute before each Scenario. Is there anyway to run it once for the entire Outline?
...
I have a Rails 2.2 app that I'm supporting and one thing that needs to be done before the app start is a small rake task to initialize and make sure the database is properly set. How can I get this task run right after rspec initializes the database. I run rspec using the rails spec command.
...
I use RSpec to test my lovely little web app. For integration tests I use Steak. When using Rails generators (yep, I know that this is not the Zen way of doing TDD) there are also some files in spec/requests generated. As stated on link text it is something similiar to integration test (but I couldn't find much more info).
Are those req...
For integration tests of my Rails web app I use Steak (something like Cucumber). The specs of Steak are in a folder named spec/acceptance. Are Steak/Cucumber now for integration or acceptance testing? I always thought that this is something different.
...
If a url parameter comes in urlencoded, does rails decode it for me, or do I have to call CGI::unencode myself?
(I'm asking because I'm seeing what is I think inconsistent behavior, and may be a bug in either rails or rspec, but wanted to ask here first to get a sanity check)
...
Hi,
Many programmers use devise as their authentication solution and I would like to get their advice:
Devise is already tested, but I want to know if there is something to test by myself (integration/unit/funtionnal tests?) for a standard devise integration with my knowledge
(I'm not familiar with shoulda and cucumber, but I know a ...
I am using infinity_test gem with rspec in a rails project. How can I get the output in color? I tried setting in terminal
rspec --color
I then ran "rspec spec/" to make sure color output was working. Then I run
infinity_test
and the test output is no longer in color. How can I get it to output in color?
...
I am attempting to get RCov to work with my RSpec and Shoulda test for a rails 3 app. It seems to work fine with my RSpec after using the Rake task below but all of the shoulda tests fail and I cant seem to find any documentation on getting these to work. They all run fine under autotest(rspec and shoulda).
namespace :spec do
desc "...
For a test suite that's already using mocha for mocking, can new tests be written with rspec mocking? maybe turn that on before(:all) and turn it back to mocha after(:all)
I tried changing the Spec::Runner configuration at run-time and that didn't seem to work with mocking
...
I've a view helper method which generates a url by looking at request.domain and request.port_string.
module ApplicationHelper
def root_with_subdomain(subdomain)
subdomain += "." unless subdomain.empty?
[subdomain, request.domain, request.port_string].join
end
end
I would like to...