Top Level Namespace

Defined Under Namespace

Modules: Webrat Classes: WordPress

Instance Method Summary collapse

Instance Method Details

#see?(content) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/cucumber-wordpress/steps.rb', line 3

def see? content
  see_within? '.', content
end

#see_within?(selector, content) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
11
12
13
14
15
# File 'lib/cucumber-wordpress/steps.rb', line 7

def see_within? selector, content
  within(selector) do |item|
    if item.nil?
      has_content? content
    else
      item.dom.to_s.include? content
    end
  end
end

#should_see_within(selector, content) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/cucumber-wordpress/steps.rb', line 17

def should_see_within selector, content
  within(selector) do |item|
    if item.nil?
      page.should have_content content
    else
      item.dom.to_s.should include content
    end
  end
end