Sha256: 01e643a958986914a033f2bb4790150188cb48491f232284dc2586da9e63764a
Contents?: true
Size: 692 Bytes
Versions: 17
Compression:
Stored size: 692 Bytes
Contents
class CheckIn::Input include RSpec::Expectations include RSpec::Matchers def initialize(label, value, within) @label = label @value = value @within = within || Capybara.current_session end def call case input.native.attribute("type") when "text" expect(input.value).to eq @value when "radio", "checkbox" case @value when "true", true expect(input).to be_selected when "false", false, nil expect(input).not_to be_selected end when "file" expect(page).to have_selector("[src$='#{@value}']") end end private def input @input ||= Pickles.find_input(@label, within: @within) end end
Version data entries
17 entries across 17 versions & 1 rubygems