Sha256: 981d69ed53a03802f4998fff0defe7eb7808bdc187a14fc3dac801d237e9b5f9

Contents?: true

Size: 1.17 KB

Versions: 15

Compression:

Stored size: 1.17 KB

Contents

Given /^I have no images$/ do
  Image.delete_all
end

When /^I attach the image at "([^\"]*)"$/ do |file_path|
  attach_file('image_image', File.join(File.expand_path('../../uploads/', __FILE__), file_path))
end

Then /^the image "([^\"]*)" should have uploaded successfully$/ do |file_name|
  Image.find_by_image_name(file_name).nil?.should == false
end

Then /^the image should have size "([^\"]*)"$/ do |size|
  Image.first.size.should == size.to_i
end

Then /^the image should have width "([^\"]*)"$/ do |width|
  Image.first.width.should == width.to_i
end

Then /^the image should have height "([^\"]*)"$/ do |height|
  Image.first.height.should == height.to_i
end

Then /^the image should have mime_type "([^\"]*)"$/ do |mime_type|
  Image.first.mime_type.should == mime_type.to_s
end

Then /^I should have ([0-9]+) images?$/ do |number|
  Image.count.should == number.to_i
end

When /^I upload the image at "([^\"]*)"$/ do |file_path|
  original_stderr = $stderr.dup
  $stderr.reopen(Tempfile.new('stderr'))
  visit new_admin_image_path
  attach_file('image_image', File.join(File.expand_path('../../uploads/', __FILE__), file_path))
  click_button 'Save'
  $stderr.reopen(original_stderr)
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
refinerycms-images-0.9.9.15 features/step_definitions/image_steps.rb
refinerycms-images-0.9.9.14 features/step_definitions/image_steps.rb
refinerycms-images-0.9.9.13 features/step_definitions/image_steps.rb
refinerycms-images-0.9.9.12 features/step_definitions/image_steps.rb
refinerycms-images-0.9.9.11 features/step_definitions/image_steps.rb
refinerycms-images-0.9.9.10 features/step_definitions/image_steps.rb
refinerycms-images-0.9.9.9 features/step_definitions/image_steps.rb
refinerycms-images-0.9.9.8 features/step_definitions/image_steps.rb
refinerycms-images-0.9.9.7 features/step_definitions/image_steps.rb
refinerycms-images-0.9.9.5 features/step_definitions/image_steps.rb
refinerycms-images-0.9.9.4 features/step_definitions/image_steps.rb
refinerycms-images-0.9.9.3 features/step_definitions/image_steps.rb
refinerycms-images-0.9.9.2 features/step_definitions/image_steps.rb
refinerycms-images-0.9.9.1 features/step_definitions/image_steps.rb
refinerycms-0.9.9 images/features/step_definitions/image_steps.rb