Skip to content

stepheneb/gruyere

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

== Welcome to Gruyere

  cp config/database.sample.yml config/database.yml

and enter a local username and password for the database

Running under JRuby:

First install the rake gem if it is not already installed.

Then install the jdbc mysql set of gems by installing: activerecord-jdbcmysql-adapter
This will also install the dependencies: activerecord-jdbc-adapter, and jdbc-mysql

If the app itself required other gems you can install them like this:

  jruby -S rake gems:install
  
The app does have gem dependencies for testing with spec 
(the test environment) and cucumber (the cucumber environment).

  RAILS_ENV=test jruby -S rake gems:install
  RAILS_ENV=cucumber jruby -S rake gems:install

Then:

  sudo gem install cucumber-rails
  sudo gem install rspec-rails
  sudo env RAILS_ENV=cucumber rake gems:install
  rake db:create:all   # (if using mysql)
  rake db:migrate
  sudo chmod 0666 log/cucumber.log

Now run the tests:

  rake cucumber

The result should be:

  (in /Users/rklancer/dev/g3/gruyere)
  Using the default profile...
  ..........

  2 scenarios (2 passed)
  10 steps (10 passed)
  0m0.181s

  
--


This is how we created these step definitions:
(Don't do this yourself! This is how the initial set of features and step definitons were populated.)

  ruby script/generate cucumber --capybara
  script/generate feature post title:string body:text published:boolean
  script/generate rspec_scaffold post title:string body:text published:boolean
  rake db:migrate

After having done this, 

  rake cucumber

generated something like this

  Using the default profile...
  Feature: Manage posts
    In order to [goal]
    [stakeholder]
    wants [behaviour]

    Scenario: Register new post             # features/manage_posts.feature:6
      Given I am on the new post page       # features/step_definitions/web_steps.rb:18
      When I fill in "Title" with "title 1" # features/step_definitions/web_steps.rb:38
      And I fill in "Body" with "body 1"    # features/step_definitions/web_steps.rb:38
      And I uncheck "Published"             # features/step_definitions/web_steps.rb:81
      And I press "Create"                  # features/step_definitions/web_steps.rb:26
      Then I should see "title 1"           # features/step_definitions/web_steps.rb:99
      And I should see "body 1"             # features/step_definitions/web_steps.rb:99
      And I should see "false"              # features/step_definitions/web_steps.rb:99

    Scenario: Delete post                    # features/manage_posts.feature:41
      Given the following posts:             # features/step_definitions/post_steps.rb:1
        | title   | body   | published |
        | title 1 | body 1 | false     |
        | title 2 | body 2 | true      |
        | title 3 | body 3 | false     |
        | title 4 | body 4 | true      |
      When I delete the 3rd post             # features/step_definitions/post_steps.rb:5
      Then I should see the following posts: # features/step_definitions/post_steps.rb:12
        | Title   | Body   | Published |
        | title 1 | body 1 | false     |
        | title 2 | body 2 | true      |
        | title 4 | body 4 | true      |

  2 scenarios (2 passed)
  11 steps (11 passed)
  0m0.929s

About

a friendly sort of cheese

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published