Topic: How to convert "true" to TrueClass
When creating a fixture for a cucumber test I came across a problem, my validations fail (as you can see below). The problem is that I have a boolean field called active that cucumber treats as a string when passing it to Cucumber::Ast::Table. Does anyone know a work around? I found the <a href="http://www.claytonlz.com/index.php/2009/06/using-rubys-true-in-cucumber-multiline-tables/">this</a> post on this problem but unfortunately the author only deals with finding a record, not creating one. Any solution would be appreciated.
Feature: Viewing the Portfolio As one who works for a living I want to record to the projects that I work on So that the world can see how good I really am! Background: Given the following projects exist: | name | url | active | | Project 1 | www.project-1.com | true | | Project 2 | www.project-2.com | false | | Project 3 | www.project-3.com | true | | Project 4 | www.project-4.com | true | | Project 5 | www.project-5.com | true | | Project 6 | www.project-6.com | false | | Project 7 | www.project-7.com | true | | Project 8 | www.project-8.com | true | | Project 9 | www.project-9.com | false | | Project 10 | www.project-10.com | false | | Project 11 | www.project-12.com | true | Validation failed: Active can't be blank (ActiveRecord::RecordInvalid) ./features/step_definitions/project_steps.rb:5 ./features/step_definitions/project_steps.rb:5:in `each' ./features/step_definitions/project_steps.rb:5:in `/^the following projects exist:$/' features/portfolio.feature:7:in `Given the following projects exist:'