Thank you, David. After removing the Webrat stuff everything runs
perfectly again.
Regards,
Kai
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
Here is also the spec helper I use for my integration tests:
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'webrat'
require 'capybara/rspec'
require "database_cleaner"
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each
Hi.
I use RSpec-Rails 2.6.1 together with Capybara 1.0.0.
Whenever I start my integration (request) tests I get the following
error:
Failure/Error: page.execute_script('$
("div.editable:first").trigger("mouseover");')
Selenium::WebDriver::Error::UnexpectedJavascriptError:
$ is not de
> hit = mock('hit')
> hit.stub(:stored) { 5 }
> hit.stored.should eq(5)
>
> Make sense?
Of course :-) Thanks.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
I use RSpec mock and stub like this:
hit = mock("hit", :stored => 5)
This works fine, but when using this instead:
hit = mock("hit").stub(:stored) { 5 }
then I get
undefined method `stored' for #
I always thought both were equivalent. Can someone enlighten me?
Regards,
Kai
__
> In the spec, the method being spec'd should be invoked through the helper:
>
> it "does something" do
> helper.method_being_specified
> end
>
> I did not mean to reference a helper object inside the implementation.
>
> Make sense?
Ah, now I got it ... you meant the template helper method
> > undefined local variable or method `helper' for #<#:
> > 0xb665532c>
>
> What's the full backtrace?
1) ApplicationHelper order link should create html link
Failure/Error: order_link(:name)
NoMethodError:
undefined method `fetch_param' for #<#:
0xb64a1ef4>
# ./app/helper
> > Failure/Error: order_link(:name)
> > NoMethodError:
> > undefined method `fetch_param' for #<#:
> > 0xb63be118>
>
> That's not the same error message you posted earlier:
>
> NoMethodError:
> undefined method `sort_direction' for
> #" error shows up when using
helper.check_param
> From this error message, it looks like you can just def it inside your
> describe block.
Thanks Matt, that seems to work.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
Ok, the tests now runs fine, but unfortunately the site itself doesn't
work anymore.
When the view gets rendered I get the following error:
undefined local variable or method `helper' for #<#:
0xb665532c>
> > module ApplicationHelper
> > def order_link(column, title = nil)
> > fetch_param(:or
> Change this ^^ to this:
>
> helper.fetch_param(:order)
I was wrong the test fails also with the same error message:
Failure/Error: order_link(:name)
NoMethodError:
undefined method `fetch_param' for #<#:
0xb63be118>
___
rspec-users maili
> This error ^^ suggests that sort_direction is being called on the example
> itself rather than the helper object. Please post the spec so we can see
> what's going on.
Sure ...
describe ApplicationHelper do
describe "order link" do
it "should create html link" do
# things I tried
My ApplicationController exposes a method (e.g. sort_direction) to the
view templates by using
helper_method :sort_direction.
I then use this method in another method (e.g. sort_link) in a view
helper (application_helper.rb).
When testing the sort_link method with RSpec (in
application_helper_spec
A big hello.
I would like to test a controller that directly renders some JSON output (by
using "render :json => @entity_names"). For that task I tried in my spec file
"response.should have_text('["enim", "enita"]')". Unfortunately I always get
that error:
Failure/Error: response.should have_t
14 matches
Mail list logo