Browse Source

prepare testing

pull/1/head
Nicolae Claudius 13 years ago
parent
commit
9579c30ba6
  1. 3
      Gemfile
  2. 9
      Gemfile.lock
  3. 1
      spec/spec_helper.rb
  4. 16
      spec/support/database_cleaner.rb
  5. 3
      spec/support/devise.rb

3
Gemfile

@ -19,7 +19,6 @@ gem 'cancan', '~> 1.6.5'
# gem "meta_where", "~> 1.0" # squeel ?
gem 'sentient_user', '~> 0.3.2'
gem 'active_scaffold', '~> 3.1.0', :git => 'https://github.com/activescaffold/active_scaffold.git' # :path => '/home/clyfe/dev/active_scaffold'
gem 'web-app-theme'
gem 'pjax_rails', '~> 0.1.10'
gem 'validates_hostname', '~> 1.0.0', :git => 'https://github.com/KimNorgaard/validates_hostname.git'
gem 'nilify_blanks', '~> 1.0.0'
@ -42,7 +41,9 @@ gem 'jquery-rails'
gem 'rspec-rails', '~> 2.6.1', :group => [:test, :development]
group :test do
gem 'forgery','~> 0.3.12'
gem 'factory_girl_rails', '~> 1.2'
gem 'capybara', '~> 1.1.1'
gem 'database_cleaner', '~> 0.6.7'
gem 'spork', '~> 0.9.0.rc'
end

9
Gemfile.lock

@ -73,6 +73,7 @@ GEM
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (~> 3.1)
database_cleaner (0.6.7)
devise (1.4.7)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.0.3)
@ -87,6 +88,8 @@ GEM
factory_girl (~> 2.1.0)
railties (>= 3.0.0)
ffi (1.0.9)
forgery (0.3.12)
nokogiri (~> 1.4)
fssm (0.2.7)
highline (1.6.2)
hike (1.2.1)
@ -192,9 +195,6 @@ GEM
multi_json (>= 1.0.2)
warden (1.0.6)
rack (>= 1.0)
web-app-theme (0.8.0)
rails (~> 3.1.0.rc6)
thor (~> 0.14)
xpath (0.1.4)
nokogiri (~> 1.3)
@ -208,8 +208,10 @@ DEPENDENCIES
capybara (~> 1.1.1)
coffee-rails (~> 3.1.0)
compass (~> 0.12.alpha.0)
database_cleaner (~> 0.6.7)
devise (~> 1.4.5)
factory_girl_rails (~> 1.2)
forgery (~> 0.3.12)
jquery-rails
mysql2
nilify_blanks (~> 1.0.0)
@ -224,4 +226,3 @@ DEPENDENCIES
therubyracer
uglifier
validates_hostname (~> 1.0.0)!
web-app-theme

1
spec/spec_helper.rb

@ -5,6 +5,7 @@ Spork.prefork do
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'capybara/rspec'
RSpec.configure do |config|
config.mock_with :rspec

16
spec/support/database_cleaner.rb

@ -0,0 +1,16 @@
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.start
end
config.after(:each) do
DatabaseCleaner.clean
end
end

3
spec/support/devise.rb

@ -0,0 +1,3 @@
RSpec.configure do |config|
config.include Devise::TestHelpers, :type => :controller
end
Loading…
Cancel
Save