From 8a3ca2a77f76e4e659f1cdaf48d4cde7a4ac3240 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Thu, 16 Jul 2015 19:24:54 +0200 Subject: [PATCH] configures factory_girl [#5] --- Gemfile | 2 ++ spec/factories.rb | 7 +++++++ spec/spec_helper.rb | 2 ++ 3 files changed, 11 insertions(+) create mode 100644 spec/factories.rb diff --git a/Gemfile b/Gemfile index 84005e07a..476024b38 100644 --- a/Gemfile +++ b/Gemfile @@ -42,5 +42,7 @@ group :development, :test do # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' gem 'rspec-rails', '~> 3.0' + gem 'capybara' + gem 'factory_girl_rails' end diff --git a/spec/factories.rb b/spec/factories.rb new file mode 100644 index 000000000..58f320ea7 --- /dev/null +++ b/spec/factories.rb @@ -0,0 +1,7 @@ +FactoryGirl.define do + factory :debate do + title 'Debate title' + description 'Debate description' + terms_of_service '1' + end +end \ No newline at end of file diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d0b233102..7ad54cc81 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,8 @@ +require 'factory_girl_rails' RSpec.configure do |config| config.filter_run :focus config.run_all_when_everything_filtered = true + config.include FactoryGirl::Syntax::Methods # Allows RSpec to persist some state between runs in order to support # the `--only-failures` and `--next-failure` CLI options.