Permalink
Browse files

Add basic cucumber steps

  • Loading branch information...
jordelver committed Dec 1, 2011
1 parent 87b3b09 commit 54746ea4151e8a57a4efc2668f89fc253e010e12
Showing with 36 additions and 0 deletions.
  1. +36 −0 template.rb
View
@@ -123,6 +123,42 @@ def anybody_signed_in?
gsub_file 'features/support/env.rb', ':transaction', ':truncation'
+create_file 'features/step_definitions/component_steps.rb' do
+ <<-'RUBY'
+Given /^I am editing content$/ do
+ @_content = Factory(:content_page)
+ visit noodall_admin_node_path(@_content)
+end
+
+Given /^place a "([^"]*)" component in a slot$/ do |component_name|
+ slot_name = case component_name
+ when 'Carousel'
+ 'Carousel Slot'
+ else
+ 'Large Slot'
+ end
+ within('ol#slot-list') do
+ click_link slot_name
+ end
+ within "#fancybox-content" do
+ select component_name, :from => 'Select the type of component'
+ end
+end
+
+When /^I view the content$/ do
+ # If we haven't saved the component yet do so
+ if page.find('#fancybox-content').visible?
+ within "#fancybox-content" do
+ click_button 'Save'
+ end
+ sleep 2
+ click_button 'Publish'
+ end
+ visit node_path(@_content)
+end
+ RUBY
+end
+
create_file 'features/support/noodall.rb' do
<<-RUBY
# Load Noodall specific stuff

0 comments on commit 54746ea

Please sign in to comment.