Displaying 17 results from an estimated 17 matches for "have_selector".
Did you mean:
have_select
2013 May 12
10
Capybara with redirect
I am having an issue where a feature works fine but the corresponding
test fails, and I can''t understand why.
I created a mock application to demonstrate the problem.
https://github.com/assafshomer/clear_button
All it does is show an input form with a clear button. The clearing
happens by redirecting back to the same form. It does clear it when you
run the app, but the test for it
2011 Jul 26
1
have_selector syntax?
Where are the docs for have_selector()?
rspec-rails 2.6.1
rails 3.0.9
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org...
2009 Apr 02
8
Problem with Custom matcher and Blocks
...it "should have a name field"
describe "the subject dropdown box" do
it "should have a feedback option" do
response.should have_a_contact_form do |form|
form.should have_a_subject_field do |subject|
subject.should have_selector(''option'', :content => ''Feedback'')
end
end
end # it "should have a feedback option"
# Etc...
end # describe "the subject dropdown box"
end # context "before the form has b...
2012 Mar 16
0
Rails tests failing
http://dl.dropbox.com/u/15024055/CloudShot/shot_15032012_232654.png
if i write the test like this its working just fine it passes green
[code]
it "should have the right title" do
get ''view''
response.should have_selector(''title'',
:content => "View Snippets")
end
[/code]
but for the same page this other format is red, they shold test for
the same thing?
[code]
require ''spec_helper''
describe "SnippetsPages" do...
2013 Jan 09
2
Rails 3.2.10 and Rspec Tests that Fail?
...first two tests):
spec/features/authentication_pages_spec.rb
require ''spec_helper''
describe "Authentication" do
subject { page }
describe "signin" do
before { visit signin_path }
it { should have_selector(''h2'', text: ''Sign in'') }
it { should have_selector(''title'', text: ''Sign in'') }
...
...
end
The first test passes, that is once I created the features directory
and...
2012 Jul 22
1
RSpec/rails & Capybara: #within
...re? There''s no way to use it on a
string, like the `page = Capybara.string(html_string)` trick?
When describe a view, I want something like that:
describe "path/to/view.html.erb" do
it "should pass" do
render
within(''form#id'') {
should have_selector ''input'', type: ''submit''
should have_selector ''input'', type: ''text'', value: ''default''
# ...
}
end
end
PS: Hope this is the right sections! ^^"
--
Posted via http://www.ruby-forum.com/.
2011 Oct 08
1
Rails view spec expectations/matchers
...ode::Simple.new(rendered)
end
end
*spec/views/comments/index.html.haml_spec.rb*
require "spec_helper"
describe "comments/index.html.haml" do
it "should show a proper breadcrumb" do
# Assign instance vars
# Mock helper methods
render
page.should have_selector("div.breadcrumb")
page.find("div.breadcrumb").tap do |node|
node.find_link("Home").should be
node.find_link("Blah1").should be
node.find_link("Blah1").should be
node.find_link("Comments").should be
end
end...
2010 Oct 20
3
rspec error's when checking LayoutLinks from the railstutorials
...s/filling-in-the-layout#top
Basically the test is something like:
spec/requests/layout_links_spec.rb
require ''spec_helper''
describe "LayoutLinks" do
it "should have a Home page at ''/''" do
get ''/''
response.should have_selector(''title'', :content => "Home")
end
Routes:
root :to => ''pages#home''
1. I already googled and found
http://stackoverflow.com/questions/3517724/rspec-is-giving-an-error-with-my-layout-links-from-the-rails-tutorial-failure-e
2. I already trie...
2011 Apr 26
1
new goodness, Capybara::RSpecMatchers in helper specs
...quire
something else in spec_helper? I have already added included
gem ''rspec-rails'', ''~> 2.6.0.rc2''
gem ''capybara'', ''~> 1.0.0.beta1''
in my Gemfile, but in a helper, I still cannot get
helper.my_fantastic_tag.should have_selector(''a'')
to work. Instead
undefined method `has_selector?'' for "test":String
Seems like the Capybara::RSpecMatchers dont get included :(
Any thoughts?
2012 Mar 01
1
Testing selector order in RSpec
Could someone point me to a reference that explains how I would test
the order of elements on an HTML page?
For example, in RSpec I would like to verify that the content of one
<p> element appears before the content of another.
response.should have_selector("p", :content => "Should appear first")
response.should have_selector("p", :content => "Should appear second")
The two lines above test that the 2 contents appear, but I don''t know
how to test that the first content appears before the second....
2010 Sep 01
2
Undefined methods: has_selector? and flunk
...I''ve seen the upgrade notice for beta20 and now include capybara
explicitly in the test group of my Gemfile. The version of capybara on
my system is 0.3.9 and noticeably, it does not define has_selector? (or
have_selector? as webrat does).
Presumably, this is all just a dependency problem, but I have no clear
idea where to look.
Michael
--
Michael Schuerig
mailto:michael at schuerig.de
http://www.schuerig.de/michael/
2012 Nov 06
2
rspec failure upon revisit
...les to (or delete)
/Users/andrewchickedantz/rails_projects/sample_app/spec/views/users/new.html.erb_spec.rb
# No reason given
# ./spec/views/users/new.html.erb_spec.rb:4
Failures:
1) LayoutLinks should have a signup page at ''/signup''
Failure/Error: response.should have_selector(''title'', :content =>
"Sign up")
expected following output to contain a <title>Sign up</title>
tag:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
char...
2010 Jun 28
1
have_tag matcher in rspec 2?
I always assumed have_tag was part of rspec, but it''s not in rspec 2,
and looking now I don''t see it in rspec 1 either. Webrat defines it, but
that seems like a coincidence (I tried requiring webrat/core/matchers to
no avail).
Is it depricated, not yet implemented, or does it work for everyone
else?
My project is from scratch, rspec-rails 2b13, using generated
spec_helper.
2011 Jul 28
2
rails 3 routing error
...''
describe SessionsController do
render_views
describe "GET ''new''" do
it "should be successful" do
get :new
response.should be_success
end
it "should have the right title" do
get :new
response.should have_selector(''title'', :content => "Sign in")
end
end
end
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-...
2013 Oct 08
1
Trouble with rspec and FactoryGirl Sequence
...;)
@users = [@user, second, third]
30.times do
@users << FactoryGirl.create(:user,
:email => FactoryGirl.generate(:email))
end
end
it "should have the right title" do
get :index
response.should have_selector("title", :content => "All users")
end
.
.
All my "get :index" tests are failing in the "for signed-in users" block
fail. They don''t fail if I just manually create a list of 30 users so
something is wrong with how I am trying to...
2010 Aug 18
2
RSpec 2/Rails 3 - content_for in view specs
...rrors.
Here is my view spec that I''m trying to run:
describe "contacts/show.html.erb" do
it "shows a URL if present" do
@contact = Factory(:complete_contact, :web_page => "
http://www.example.com") # Using Factory Girl
render
rendered.should have_selector("span", :content => "
http://www.example.com")
end
end
Thank you!
Dylan Markow
dmarkow at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20100818/5ae5b44c/attachment.html...
2011 Jul 25
6
What does using a lambda in rspec tests accomplish?
...#39;' }
end
it "should not create a user" do
lambda {
post :create, :user => @attr
}.should_not change(User, :count)
end
it "should have the right title" do
post :create, :user => @attr
response.should have_selector(:title, :content => ''Sign up'')
end
Comparing the last two tests, it looks to me like:
lambda {
post :create, :user => @attr
}.should_not change(User, :count)
should be equivalent to:
post :create, :user => @attr
resp...