Sha256: 1beb740a75966897c4347796ad658dc43967076085b45d2c5736c94dbfa17914
Contents?: true
Size: 1.64 KB
Versions: 11
Compression:
Stored size: 1.64 KB
Contents
Then /^I should see a select filter for "([^"]*)"$/ do |label| expect(page).to have_css '.filter_select label', text: label end Then /^I should see a string filter for "([^"]*)"$/ do |label| expect(page).to have_css '.filter_string label', text: label end Then /^I should see a date range filter for "([^"]*)"$/ do |label| expect(page).to have_css '.filter_date_range label', text: label end Then /^I should see the following filters:$/ do |table| table.rows_hash.each do |label, type| step %{I should see a #{type} filter for "#{label}"} end end Given(/^I add parameter "([^"]*)" with value "([^"]*)" to the URL$/) do |key, value| url = page.current_url separator = url.include?('?') ? '&' : '?' visit url + separator + key.to_s + '=' + value.to_s end Then(/^I should( not)? have parameter "([^"]*)" with value "([^"]*)"$/) do |negative, key, value| query = URI(page.current_url).query if query.nil? expect(negative).to eq true else params = Rack::Utils.parse_query query expect(params[key]).to_not eq value if negative expect(params[key]).to eq value unless negative end end Then /^I should see current filter "([^"]*)" equal to "([^"]*)" with label "([^"]*)"$/ do |name, value, label| expect(page).to have_css "li.current_filter_#{name} span", text: label expect(page).to have_css "li.current_filter_#{name} b", text: value end Then /^I should see current filter "([^"]*)" equal to "([^"]*)"$/ do |name, value| expect(page).to have_css "li.current_filter_#{name} b", text: value end Then /^I should see link "([^"]*)" in current filters/ do |label| expect(page).to have_css "li.current_filter b a", text: label end
Version data entries
11 entries across 11 versions & 2 rubygems