Skip to content

Commit

Permalink
Add RSpec and factory_girl
Browse files Browse the repository at this point in the history
  • Loading branch information
gglin committed Jun 2, 2013
1 parent a6bdbaa commit e854c16
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 0 deletions.
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--color
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ group :development, :test do
gem 'sqlite3'
end

group :development, :test do
gem 'rspec-rails'
gem 'factory_girl_rails'
end

group :test do
gem 'capybara'
end
Expand Down
20 changes: 20 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,15 @@ GEM
orm_adapter (~> 0.1)
railties (~> 3.1)
warden (~> 1.2.1)
diff-lcs (1.2.4)
erubis (2.7.0)
execjs (1.4.0)
multi_json (~> 1.0)
factory_girl (4.2.0)
activesupport (>= 3.0.0)
factory_girl_rails (4.2.1)
factory_girl (~> 4.2.0)
railties (>= 3.0.0)
hike (1.2.2)
i18n (0.6.1)
journey (1.0.4)
Expand All @@ -65,6 +71,7 @@ GEM
treetop (~> 1.4.8)
mime-types (1.23)
multi_json (1.7.4)
nokogiri (1.5.9)
nokogiri (1.5.9-x86-mingw32)
orm_adapter (0.4.0)
pg (0.14.1)
Expand Down Expand Up @@ -95,6 +102,17 @@ GEM
rake (10.0.4)
rdoc (3.12.2)
json (~> 1.4)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.13.1)
rspec-rails (2.13.2)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 2.13.0)
rspec-expectations (~> 2.13.0)
rspec-mocks (~> 2.13.0)
sass (3.2.9)
sass-rails (3.2.6)
railties (~> 3.2.0)
Expand Down Expand Up @@ -131,9 +149,11 @@ DEPENDENCIES
capybara
coffee-rails (~> 3.2.1)
devise
factory_girl_rails
jquery-rails
pg
rails (= 3.2.13)
rspec-rails
sass-rails (~> 3.2.3)
simple_form
sqlite3
Expand Down
38 changes: 38 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }

RSpec.configure do |config|
# ## Mock Framework
#
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
#
# config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr

# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
config.fixture_path = "#{::Rails.root}/spec/fixtures"

# If you're not using ActiveRecord, or you'd prefer not to run each of your
# examples within a transaction, remove the following line or assign false
# instead of true.
config.use_transactional_fixtures = true

# If true, the base class of anonymous controllers will be inferred
# automatically. This will be the default behavior in future versions of
# rspec-rails.
config.infer_base_class_for_anonymous_controllers = false

# Run specs in random order to surface order dependencies. If you find an
# order dependency and want to debug it, you can fix the order by providing
# the seed, which is printed after each run.
# --seed 1234
config.order = "random"
end

0 comments on commit e854c16

Please sign in to comment.