Skip to content

Instantly share code, notes, and snippets.

@ivanoats
Created March 26, 2012 22:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivanoats/2210420 to your computer and use it in GitHub Desktop.
Save ivanoats/2210420 to your computer and use it in GitHub Desktop.
Cucumber save and open page issue
require 'rubygems'
require 'cucumber/rails'
require 'capybara/rails'
Capybara.default_selector = :css
ActionController::Base.allow_rescue = false
begin
DatabaseCleaner.strategy = :transaction
rescue NameError
raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it."
end
require 'factory_girl/step_definitions'
Cucumber::Rails::Database.javascript_strategy = :truncation
Dir["../../spec/factories/*.rb"].each {|file| require_relative file }
Given /^a no fee license called "([^"]*)"$/ do |arg1|
@l = FactoryGirl.create(:license,
name: arg1,
status: License::PUBLISHED_STATUS,
way: License::CLICK_WAY,
express_license_technology_id: 1,
fee: 154,
allocation_rule_number: 66,
licensefile: File.new(Rails.root +
"spec/fixtures/test-license.pdf"))
end
Given /^a technology called "([^"]*)"$/ do |arg1|
@t = FactoryGirl.create(:express_license_technology,
name: arg1,
status: ExpressLicenseTechnology::PUBLISHED_STATUS)
end
When /^I am on the license page for "([^"]*)"$/ do |arg1|
@l= License.find_by_name(arg1)
visit(license_path(@l))
save_and_open_page
end
Feature: No Fee License
In order to license a technology without a fee
As a site visitor
I want execute a license
Background:
Given a technology called "test no fee license tech"
And a no fee license called "test no fee license"
Scenario: no fee license collects licensee info
When I am on the license page for "test no fee license"
Then I should see a form for licensee info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment