Sha256: 42c175cffcc2d4012dfb28c5b1d0feda6eaed377c0ef6c99fe8ca5235cebe7f8

Contents?: true

Size: 903 Bytes

Versions: 15

Compression:

Stored size: 903 Bytes

Contents

module ContentHelpers

  # Passing the xpath in the methods below is useful to check for
  # content in any item of a list, for example
  # page_has_content("Hi", './/li[@id="my-element"]'

  def page_has_content(text, xpath=nil)
    if xpath.nil?
      page.should have_content(text)
    else
      page.should_not have_xpath(xpath, :text => text)
    end
  end

  def page_doesnt_have_content(text, xpath=nil)
    if xpath.nil?
      page.should_not have_content(text)
    else
      page.should_not have_xpath(xpath, :text => text)
    end
  end

  def has_content(text, xpath=nil)
    if xpath.nil?
      should have_content(text)
    else
      should have_xpath(xpath, :text => text)
    end
  end

  def doesnt_have_content(text, xpath=nil)
    if xpath.nil?
      should_not have_content(text)
    else
      should_not have_xpath(xpath, :text => text)
    end
  end

end

World(ContentHelpers)

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
bigbluebutton_rails-3.0.0 spec/rails_app/features/support/content.rb
bigbluebutton_rails-2.3.0 spec/rails_app/features/support/content.rb
bigbluebutton_rails-2.2.0 spec/rails_app/features/support/content.rb
bigbluebutton_rails-2.1.0 spec/rails_app/features/support/content.rb
bigbluebutton_rails-2.0.0 spec/rails_app/features/support/content.rb
bigbluebutton_rails-1.3.0.mweb1 spec/rails_app/features/support/content.rb
bigbluebutton_rails-1.4.0 spec/rails_app/features/support/content.rb
bigbluebutton_rails-1.4.0.beta1 spec/rails_app/features/support/content.rb
bigbluebutton_rails-1.3.0 spec/rails_app/features/support/content.rb
bigbluebutton_rails-1.3.0.beta1 spec/rails_app/features/support/content.rb
bigbluebutton_rails-1.2.0 spec/rails_app/features/support/content.rb
bigbluebutton_rails-1.1.0 spec/rails_app/features/support/content.rb
bigbluebutton_rails-1.0.0 spec/rails_app/features/support/content.rb
bigbluebutton_rails-0.1.1 spec/rails_app/features/support/content.rb
bigbluebutton_rails-0.1.0 spec/rails_app/features/support/content.rb