Sha256: 2518720c90679178e6036c6bf941728b074e2c02a44eebccd057ba76c600c8f7

Contents?: true

Size: 1.09 KB

Versions: 9

Compression:

Stored size: 1.09 KB

Contents

When(/^I select to add a "(.*?)" from the "(.*?)" area$/) do |element_name, area_name|
  area = Newsletter::Area.where(name: area_name.downcase.gsub(/ /,'_')).first 
  within(:css,"#add_element_for_area_#{area.id}") do
    step %Q|I select "#{element_name}" from "Area: #{area.name.humanize}"|
  end
end

When(/^I press the "(.*?)" area's "(.*?)" button$/) do |area_name, add_element|
  area = Newsletter::Area.where(name: area_name.downcase.gsub(/ /,'_')).first 
  within(:css,"#add_element_for_area_#{area.id}") do
    step %Q|I press "Add Element"|
  end
end

Then(/^a "(.*?)" should exist in "(.*?)"'s "(.*?)" are with an? "(.*)" ([^"]+) of "(.*?)"$/) do |element_name, newsletter_name, area_name, field_name, method, value|
  newsletter = Newsletter::Newsletter.where(name: newsletter_name).last
  area = newsletter.areas.detect{|a| a.name.eql?(underscore(area_name))}
  element = area.elements.detect{|e| e.name.eql?(element_name)}
  expect(newsletter.pieces.detect{|piece|
    piece.area == area && piece.element == element &&
    piece.locals[field_name.to_sym].send(method) == value
  }).not_to be nil
end



Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
newsletter-3.2.25.1 spec/test_app/features/step_definitions/piece_steps.rb
newsletter-3.2.22.0 spec/test_app/features/step_definitions/piece_steps.rb
newsletter-3.2.7 spec/test_app/features/step_definitions/piece_steps.rb
newsletter-3.2.6 spec/test_app/features/step_definitions/piece_steps.rb
newsletter-3.2.5 spec/test_app/features/step_definitions/piece_steps.rb
newsletter-3.2.4 spec/test_app/features/step_definitions/piece_steps.rb
newsletter-3.2.2 spec/test_app/features/step_definitions/piece_steps.rb
newsletter-3.2.1 spec/test_app/features/step_definitions/piece_steps.rb
newsletter-3.2.0 spec/test_app/features/step_definitions/piece_steps.rb