Class: CheckIn::Image

Inherits:
Object
  • Object
show all
Includes:
RSpec::Expectations, RSpec::Matchers
Defined in:
lib/cucumber/pickles/steps/check_in/image.rb

Instance Method Summary collapse

Constructor Details

#initialize(label = nil, value, within) ⇒ Image

Returns a new instance of Image.



6
7
8
9
10
# File 'lib/cucumber/pickles/steps/check_in/image.rb', line 6

def initialize(label = nil, value, within)
  @label = label
  @value = value
  @within = within || Capybara.current_session
end

Instance Method Details

#call(is_not = false) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/cucumber/pickles/steps/check_in/image.rb', line 12

def call(is_not = false)
  if is_not
    expect(@within).not_to have_selector("img[src*='#@value']")
  else
    expect(@within).to have_selector("img[src*='#@value']")
  end
end