features/step_definitions/web_steps.rb in paperclip-4.3.0 vs features/step_definitions/web_steps.rb in paperclip-4.3.1

- old
+ new

@@ -101,109 +101,7 @@ When /^(?:|I )attach the file "([^"]*)" to "([^"]*)"$/ do |path, field| attach_file(field, File.expand_path(path)) end Then /^(?:|I )should see "([^"]*)"$/ do |text| - if page.respond_to? :should - page.should have_content(text) - else - assert page.has_content?(text) - end -end - -Then /^(?:|I )should see \/([^\/]*)\/$/ do |regexp| - regexp = Regexp.new(regexp) - - if page.respond_to? :should - page.should have_xpath('//*', :text => regexp) - else - assert page.has_xpath?('//*', :text => regexp) - end -end - -Then /^(?:|I )should not see "([^"]*)"$/ do |text| - if page.respond_to? :should - page.should have_no_content(text) - else - assert page.has_no_content?(text) - end -end - -Then /^(?:|I )should not see \/([^\/]*)\/$/ do |regexp| - regexp = Regexp.new(regexp) - - if page.respond_to? :should - page.should have_no_xpath('//*', :text => regexp) - else - assert page.has_no_xpath?('//*', :text => regexp) - end -end - -Then /^the "([^"]*)" field(?: within (.*))? should contain "([^"]*)"$/ do |field, parent, value| - with_scope(parent) do - field = find_field(field) - if field.value.respond_to? :should - field.value.should =~ /#{value}/ - else - assert_match(/#{value}/, field.value) - end - end -end - -Then /^the "([^"]*)" field(?: within (.*))? should not contain "([^"]*)"$/ do |field, parent, value| - with_scope(parent) do - field = find_field(field) - if field.value.respond_to? :should_not - field.value.should_not =~ /#{value}/ - else - assert_no_match(/#{value}/, field.value) - end - end -end - -Then /^the "([^"]*)" checkbox(?: within (.*))? should be checked$/ do |label, parent| - with_scope(parent) do - field_checked = find_field(label)['checked'] - if field_checked.respond_to? :should - field_checked.should eq true - else - assert field_checked - end - end -end - -Then /^the "([^"]*)" checkbox(?: within (.*))? should not be checked$/ do |label, parent| - with_scope(parent) do - field_checked = find_field(label)['checked'] - if field_checked.respond_to? :should - field_checked.should eq false - else - assert !field_checked - end - end -end - -Then /^(?:|I )should be on (.+)$/ do |page_name| - current_path = URI.parse(current_url).path - if current_path.respond_to? :should - current_path.should == path_to(page_name) - else - assert_equal path_to(page_name), current_path - end -end - -Then /^(?:|I )should have the following query string:$/ do |expected_pairs| - query = URI.parse(current_url).query - actual_params = query ? CGI.parse(query) : {} - expected_params = {} - expected_pairs.rows_hash.each_pair{|k,v| expected_params[k] = v.split(',')} - - if actual_params.respond_to? :should - actual_params.should == expected_params - else - assert_equal expected_params, actual_params - end -end - -Then /^show me the page$/ do - save_and_open_page + expect(page).to have_content(text) end