Sha256: 52e559bbcd6c3432f2ad5b654dd0e254e1c41fb47eab9a76ccec6d9f59824700
Contents?: true
Size: 880 Bytes
Versions: 6
Compression:
Stored size: 880 Bytes
Contents
When /^a Content Type named "Product" is registered$/ do p = "Product" Cms::ContentType.create!(:name => p, :group_name => p) end Given /^the following products exist:$/ do |table| # table is a | 1 | iPhone | 400 | table.hashes.each do |row| Product.create!(:id=>row['id'], :name=>row['name'], :price=>row['price']) end end When /^I delete "([^"]*)"$/ do |product_name| p = Product.find_by_name(product_name) page.driver.delete "/cms/products/#{p.id}" end Then /^I should be redirected to ([^"]*)$/ do |path| assert_equal "http://www.example.com#{path}", page.response_headers["Location"] end Then /^"([^"]*)" should be selected as the current Content Type$/ do |name| select = name.tableize.singularize if name == "Text" select = "html_block" end li = find(:xpath, "//li[@rel='select-#{select}']") assert li['class'].include?("on") end
Version data entries
6 entries across 6 versions & 1 rubygems