The following tests used to reside in requests directory and used to work ... since I have upgraded to rails 3.2.9 and now 3.2.10 they fail. I have the following tests in(I am only showing the 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 moved the authentication_pages_spec file to it, and the second fails with the message "expected to find css ''title'' with "Sign in" but the were no matches. The application code( I am showing just the first three lines since the rest are the attributes for this view): app/views/sessions/new.html.haml - provide(:title, ''Sign in'') %h2 Sign in = form_for(:session, url: sessions_path) do |f| ... ... It looks to me that I have all the necessary features in place for the test to pass. So it can only mean that something else is the problem, maybe the syntax of the test has changed? Does anyone have some thoughts on this? Thanks. -- 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 To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Capybara 2.0 upwards no longer supports Title tests see: https://github.com/jnicklas/capybara/issues/844 I used the solution, work around, given by ''murdoch'' towards the end of the discussion, namely: should have_xpath("//title[contains(.,''marflar'')]") now my title tests work ... thanks On Jan 9, 10:40 am, fuzzy <hlog...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> The following tests used to reside in requests directory and used to > work ... since I have upgraded to rails 3.2.9 and now 3.2.10 they > fail. > I have the following tests in(I am only showing the 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 moved the authentication_pages_spec file to it, and the second > fails with the message "expected to find css ''title'' with "Sign in" > but the were no matches. > > The application code( I am showing just the first three lines since > the rest are the attributes for this view): > app/views/sessions/new.html.haml > > - provide(:title, ''Sign in'') > %h2 Sign in > = form_for(:session, url: sessions_path) do |f| > ... > ... > It looks to me that I have all the necessary features in place for the > test to pass. So it can only mean that something else is the problem, > maybe the syntax of the test has changed? > > Does anyone have some thoughts on this? > > Thanks.-- 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 To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
I found another solution ... a little more professional in my opinion. It has to do with defining a Rspec_matcher ... see it here: http://stackoverflow.com/questions/13573525/rspec-capybara-2-0- tripping-up-my-have-selector-tests It works great. On Jan 11, 1:30 pm, fuzzy <hlog...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Capybara 2.0 upwards no longer supports Title tests see: > > https://github.com/jnicklas/capybara/issues/844 > > I used the solution, work around, given by ''murdoch'' towards the end > of the discussion, namely: > > should have_xpath("//title[contains(.,''marflar'')]") > > now my title tests work ... thanks > > On Jan 9, 10:40 am, fuzzy <hlog...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > The following tests used to reside in requests directory and used to > > work ... since I have upgraded to rails 3.2.9 and now 3.2.10 they > > fail. > > I have the following tests in(I am only showing the 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 moved the authentication_pages_spec file to it, and the second > > fails with the message "expected to find css ''title'' with "Sign in" > > but the were no matches. > > > The application code( I am showing just the first three lines since > > the rest are the attributes for this view): > > app/views/sessions/new.html.haml > > > - provide(:title, ''Sign in'') > > %h2 Sign in > > = form_for(:session, url: sessions_path) do |f| > > ... > > ... > > It looks to me that I have all the necessary features in place for the > > test to pass. So it can only mean that something else is the problem, > > maybe the syntax of the test has changed? > > > Does anyone have some thoughts on this? > > > Thanks.-- 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 To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.