Given (/^the "(.+)" field contains an image$/) do |field_name|
  @context.given_an_image(field_name)
end

When(/^I upload an? (new|reusable) image to the "(?:.+)" field for the page partial$/) do |type|
  type == 'new'? @context.upload_image : @context.upload_reusable_image
end

When(/^I remove the image from the field$/) do
  @context.remove_image
end

Then(/^the image should be reusable$/) do
  @context.expect_content_on_page('Image is Reusable')
  @context.expect_reusable_in_database
end

Then(/^the image field (?:should|should not) contain the image$/) do
  @context.expect_correct_src
end
