LoginSignup
3
3

More than 5 years have passed since last update.

Rails 4.0 にturnipセットアップメモ

Last updated at Posted at 2014-09-11

エンドツーエンドのテストを行うため導入してみました。

参考

rail4.0へのセットアップ手順

1. Gemfile

# Gemfile

group :test do
  gem 'rspec-rails'
  gem 'turnip'
end

※ 参考 https://github.com/jnicklas/turnip

2. rspec install

bundle exec rails g rspec:install

3. テスト用ディレクトリ生成

mkdir ./spec/features
mkdir ./spec/steps

4. .rspecの編集

# ./rspec
--color
-r turnip/rspec

5. spec/turnip_helper.rbの作成

# spec/turnip_helper.rb
require 'rails_helper'
Dir.glob("spec/steps/**/*steps.rb") { |f| load f, true }

6. featureやstepファイルの作成

  • 参考

http://gongo.hatenablog.com/entry/2013/05/29/223218
http://qiita.com/moriyaman/items/af2a0264adbaaa0d2029

7. turnip(rspec)実行

bundle exec rspec

capybaraのセットアップに続きます

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3