Displaying 20 results from an estimated 20 matches for "have_text".
2010 Sep 30
5
response.should have_text leads to undefined method `has_text?'
One of my controllers directly renders some JSON output that I would
like to test with RSpec. For that I use ''response.should
have_text("foobar")'' in my spec file, but that leads to a
Failure/Error: response.should have_text("enim")
undefined method `has_text?'' for #<ActionController::TestResponse:
0xb6736944>
I read here somewhere that webrat should be in the Gemfile, but that
also did...
2007 May 19
2
have_text matcher does not support should_not.
...llo Guys,
Doing conversion of some test for some controllers, still with integrated views.
Anyway, I have this:
it "should not see Join This Group button on profile page as member" do
get "show", :id => @group.id
response.should be_success
response.should_not have_text(/Join This Group/)
end
But running with spec (0.9.4), drop me the folling error:
Matcher does not support should_not.
See Spec::Matchers for more information
about matchers.
Which is contradictory, since RDoc state otherwise:
http://rspec.rubyforge.org/rdoc-rails/classes/Spec/Rails/Matchers.h...
2008 Dec 10
3
rspecing rjs - form.reset(''form'')
Hello,
>
> I couldn''t find much info on this.
>
> How do you rspec this: page.form.reset("form")
>
> I looked in the have_rjs source code and I can''t find anything on form
> reset.
>
> Thanks,
>
> --
> Andrei
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2007 Oct 05
13
spec''ing view render partial collection, local variable not found
...partial collection but I get the following
error
2)
NoMethodError in ''/games/_game.rhtml should show game name''
undefined method `body'' for #<#<Class:0x316580c>:0x2f1154c>
/Volumes/EXTERNAL/web/omenking.ca/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/have_text.rb:12:in
`matches?''
./spec/views/games/_game.rhtml_spec.rb:39:
def before
game = mock_model(Game,
:name => ''The Battle for Blaze'',
:salt_grains => 5000000,
:people => 5000000,
:days => nil,
:created_at => "Mon Oct 0...
2007 Sep 25
7
simple story, extract link
hi,
I just started fooling around with story runner, thought I''d start
with a dead simple scenario:
The first thing I do when describing a site to someone is go to the
home page, and begin exploring public pages from there.
So, that seems like a good first story to spec out.
And I''d really like to extract the actual link from the rendered page
(rather than just
2007 Oct 16
6
RailsStory runner - empty response
...e view of the system
}, :type => RailsStory do
Scenario "Publisher with no videos" do
When "visiting", "/" do |page|
get page
end
Then "viewer should see", "companies/show_initial" do |template|
response.should have_text(/Welcome/)
end
end
end
When I run the story, I get the error:
kwigger:~/workspace/rspec-stories alvin$ ruby stories/all.rb
Running 1 scenarios:
Story: View Home Page
As a user
I want to view my home page
So that I can get a birds eye view of the system
Scenario: Publisher with no...
2007 May 21
4
Just upgraded to 1.0.0, should render_text isn''t working for me
I finally got around to upgrading from 0.8.2 (!!). I had a spec which
looked like
specify "should render abc123" do
controller.should_render :text => "abc123"
get :key
end
With 1.0.0, the new spec is
it "should render abc123" do
get :key
response.should render_text("abc123")
end
However it doesn''t work, giving me the error:
undefined
2007 Jun 15
2
Is it still possible to use should_have_rjs
Hi
I''ve come back to a Rails project after about a month doing other
work, and there''s a lot of changes. I was on the 0.7 branch before
and I''ve upgraded to RSpec 1.0.5. I used the spec translator, fixed
the cases where it barfed on unusual line contents, and all my model
and controller specs now pass. But I''m getting 53 failures on my view
specs,
2007 Oct 02
1
flash in story runner
hi,
is there a way to assert a flash message directly in story runner? Or
do I have to go through the response text instead.
Then "flash message should say success" do
#flash[:notice].should == "User successfully invited"
response.should have_text(/User successfully invited/)
end
linoj
2008 Apr 11
4
request.params causing errors
Hello,
I have a rhtml file that goes through the request.params. One of my test
generates that file, but rspec pops an error saying :
undefined method ''params'' for ...
I''m not sure what to do with this, since request.params actually works with
rails.
Any idea?
Thank you
Olivier Dupuis
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2008 Jun 03
9
Build rspec-rails as a gem?
I can''t figure out how to build rspec-rails as a gem when just cloned
from github... there isn''t any .gemspec file or rake task that does
this. Any help?
--
Posted via http://www.ruby-forum.com/.
2008 Jun 02
2
Cannot log in/authenticate within RSpec Story
...;domain\\username'', :password =>
''password''}
follow_redirect if redirect?
end
When "I visit the post details page" do
get(''/posts/1'')
end
Then "there should be a link to add a new comment" do
response.should have_text(/.*Add New Comment.*/)
end
--------------------------------------------------
The "Add New Comment" text will only show up within the view if
!session[''username''].nil?
The login controller looks like this:
--------------------------------------------------
def l...
2007 Dec 20
19
Story runner rake task
What''s the status on a rake task for the story runner. If nothing is
in progress, where could I start to try and build one?
JD
2007 Sep 23
4
Story Runner, autoincrementing
I''ve written a story and I run into a snag.
I''ve written the create_forum method and told it to set the id to 1
but when it creates the forum the id is autoincremented.
My forums table is empty but the id keeps incrementing the newest record on
creation.
When I run the story it comes out as something like 59 which fails my story
because I''m asking it to look at /forums/1
2007 Sep 08
0
Writing specs for scriptaculous helper
...lves. For instance, I
have a div containing a bunch of thumbnails which I''m going to make
sortable with sortable_element. I''m trying to figure out a good way
to write a spec for this type of call. so far the closest I have
gotten is to write something like
response.should have_text Regexp.new(''Sortable.create\
("gallery_1_thumbnails"'')
Which works, but seems a bit ugly (and could possibly break if
Scriptaculous changed. It just seems a little too "hard coded". Is
there a better way?
Thanks,
Leslie
2009 Oct 13
0
RSpec, flash messages and redirection
...thing like "I should see ''some text''"
that text is set on a flash message in the controller and displayed by
= flash[:notice] in the layout view, so the relevant part of my view
says, in haml:
.notice
= flash[:notice]
The rspec evaluation for that says:
response.should have_text("blah")
The spec fails saying that the text "blah" cannot be found on the
response, shows the HTML code that rspec got and, in fact, the text is
not there.
But, if I run the application, the text is shown, even when I run the
application on test mode (RAILS_ENV=test script/serv...
2012 Jun 14
3
response.should have_content("1 movie") does not seem to work for me
Hey everybody
I have worked quite to near the end of The RSpec Book, but now I''m
having some troubles.
I''m trying to get the last few Cucumber steps to work, which are:
Then /^Caddyshack should be in the Comedy genre$/ do
visit genres_path
click_link "Comedy"
save_and_open_page
response.should have_content("1 movie")
response.should
2008 Jan 21
5
attachment_fu and story runner, any updates
I''m trying to write a story for a Rails app which involves using the
attachment_fu plugin to upload images.
After blunting my pick on this for a while, google found me this:
http://www.ruby-forum.com/topic/134743#600831
So it seems that there''s a hole in Rails integration testing and
multipart form posting. David offered to incorporate a patch to story
runner at the end of the
2007 Oct 01
15
how to spec views
I''m trying to spec a view but haven''t done much view specing.
This view render different partials depending on authentication of the user:
annon, admin, player
So I I''ll write if conditionals in the view with the partials
it "should render signup propaganda for annon users trying to view games"
do
render "/games/index.rhtml"
2007 Jul 26
5
Coding standards and whitespace
...sl/behaviour/helper.rb
rspec_on_rails/lib/spec/rails/dsl/behaviour/render_observer.rb
rspec_on_rails/lib/spec/rails/dsl/behaviour/view.rb
rspec_on_rails/lib/spec/rails/extensions/action_controller/base.rb
rspec_on_rails/lib/spec/rails/matchers/assert_select.rb
rspec_on_rails/lib/spec/rails/matchers/have_text.rb
rspec_on_rails/lib/spec/rails/matchers/redirect_to.rb
rspec_on_rails/lib/spec/rails/matchers/render_template.rb
rspec_on_rails/lib/spec/rails.rb
rspec_on_rails/MIT-LICENSE
rspec_on_rails/spec/rails/autotest/mappings_spec.rb
rspec_on_rails/spec/rails/dsl/behaviour_factory_spec.rb
rspec_on_rails/s...