Created
March 26, 2012 22:56
-
-
Save ivanoats/2210420 to your computer and use it in GitHub Desktop.
Cucumber save and open page issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 } | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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