Sha256: 47c6b05e9cc330802ad77fed29fbc3fcfe3f2882f1e94894ec62a53e7b6de565

Contents?: true

Size: 1.77 KB

Versions: 17

Compression:

Stored size: 1.77 KB

Contents

##########################################################
# RE_VIEW_STEPS
#
#   Then I should see the view "[template]"
#   Then I should see the "[link title]" link
#   Then I should see the "[link title]" link to [link|the link page]
#   Then I should see the "[title]" button
#
#   Then I should see the "[model]" "[field]" value
#
#   Then I should see the breadcrumb "[title]" link to [link|the link page]
#   Then I should see the breadcrumb "[title]"
    
Then /^I should see the view "(.*)"$/ do |template_page|
  response.should render_template(template_for(template_page))
end  

Then /^I should see the "([^\"]*)" link$/ do |link_title|
  response.should have_tag("a", :text => link_title)
end

Then /^I should see the "([^\"]*)" link to (.*)$/ do |link_title, link_page|
  response.should have_tag("a[href=#{path_to(link_page)}]", :text => link_title)
end

Then /^I should see the "([^\"]*)" button$/ do |title|
  if title =~ /^Choose File$/ 
    response.should have_tag("input[type=file]")
  else  
    response.should have_tag("input[value=#{title}]")
  end  
end

Then /^I should see the "([^\"]*)" "([^\"]*)" value$/ do |model, field|
  tmp_model = instance_variable_get("@#{model}")
  tmp_model.should_not be_nil

  response.should contain(tmp_model[field.to_sym])
end

Then /^I should see the breadcrumb "([^\"]*)" link to ([^\"]*)$/ do | link_title, link_page |
  breadcrumbs = response.template.instance_variable_get("@content_for_defer_re_breadcrumbs")
  breadcrumbs.should have_tag("div.re-breadcrumbs a[href=#{path_to(link_page)}]", :text => link_title)
end

Then /^I should see the breadcrumb title "([^\"]*)"$/ do |title|
  breadcrumbs = response.template.instance_variable_get("@content_for_defer_re_breadcrumbs")
  breadcrumbs.should have_tag("div.re-breadcrumbs em", :text => title)
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
rules_engine-0.2.0 rails_generators/templates/features/step_definitions/common/re_view_steps.rb
rules_engine-0.1.10 rails_generators/templates/features/step_definitions/common/re_view_steps.rb
rules_engine-0.1.9 rails_generators/templates/features/step_definitions/common/re_view_steps.rb
rules_engine-0.1.8 rails_generators/templates/features/step_definitions/common/re_view_steps.rb
rules_engine-0.1.7 rails_generators/templates/features/step_definitions/common/re_view_steps.rb
rules_engine-0.1.6 rails_generators/templates/features/step_definitions/common/re_view_steps.rb
rules_engine-0.1.5 rails_generators/templates/features/step_definitions/common/re_view_steps.rb
rules_engine-0.1.4 rails_generators/templates/features/step_definitions/common/re_view_steps.rb
rules_engine-0.1.3 rails_generators/templates/features/step_definitions/common/re_view_steps.rb
rules_engine-0.1.1 rails_generators/templates/features/step_definitions/common/re_view_steps.rb
rules_engine-0.1.0 rails_generators/templates/features/step_definitions/common/re_view_steps.rb
rules_engine-0.0.8 rails_generators/templates/features/step_definitions/common/re_view_steps.rb
rules_engine-0.0.7 rails_generators/templates/features/step_definitions/common/re_view_steps.rb
rules_engine-0.0.6 rails_generators/templates/features/step_definitions/common/re_view_steps.rb
rules_engine-0.0.5 rails_generators/templates/features/step_definitions/common/re_view_steps.rb
rules_engine-0.0.4 rails_generators/templates/features/step_definitions/common/re_view_steps.rb
rules_engine-0.0.3 rails_generators/templates/features/step_definitions/common/re_view_steps.rb