I can't figure what is the difference betwen these 2 matchers definition:

page.should have_selection('title', text: full_title('Home')) - fails, 
can(t find the title content
page.should have_selection('title', full_title('Home')) - passes

I defined the 'full_title' in ApplicationHelper:

module ApplicationHelper
  def full_title(page_title)
    base_title = I18n.t(:base_title)
    if page_title.empty?
      base_title
    else
      "#{base_title} | #{page_title}"
    end
  end
end

and required in in features/env.rb to use in Cucumber:

World(ApplicationHelper)

In the aplication layout page the call to full_title is done as follows:

<title><%= full_title(yield(:title)) %></title>

And in the home/index page it is used like that:

<% provide(:title, 'Home') %>

Any ideas? Thank you.



-- 
You received this message because you are subscribed to the Google Groups 
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msg/rspec/-/0YIfTdVPrm4J.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to