Sha256: 7ef2541538e99edae597fca4f4d171bb692e53e7a4298254e1c1db729423088d

Contents?: true

Size: 1.17 KB

Versions: 17

Compression:

Stored size: 1.17 KB

Contents

Given /^I have no images$/ do
  Image.destroy_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

17 entries across 17 versions & 1 rubygems

Version Path
refinerycms-images-1.0.11 features/step_definitions/image_steps.rb
refinerycms-images-1.0.10 features/step_definitions/image_steps.rb
refinerycms-images-1.0.9 features/step_definitions/image_steps.rb
refinerycms-images-1.0.8 features/step_definitions/image_steps.rb
refinerycms-images-1.0.7 features/step_definitions/image_steps.rb
refinerycms-images-1.0.5 features/step_definitions/image_steps.rb
refinerycms-images-1.0.4 features/step_definitions/image_steps.rb
refinerycms-images-1.0.3 features/step_definitions/image_steps.rb
refinerycms-images-1.0.1 features/step_definitions/image_steps.rb
refinerycms-images-1.0.0 features/step_definitions/image_steps.rb
refinerycms-images-0.9.9.22 features/step_definitions/image_steps.rb
refinerycms-images-0.9.9.21 features/step_definitions/image_steps.rb
refinerycms-images-0.9.9.20 features/step_definitions/image_steps.rb
refinerycms-images-0.9.9.19 features/step_definitions/image_steps.rb
refinerycms-images-0.9.9.18 features/step_definitions/image_steps.rb
refinerycms-images-0.9.9.17 features/step_definitions/image_steps.rb
refinerycms-images-0.9.9.16 features/step_definitions/image_steps.rb