Created
March 11, 2014 01:07
-
-
Save jeffstagg/9477647 to your computer and use it in GitHub Desktop.
Ruby env with failing spec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User | |
include Mongoid::Document | |
# Include default devise modules. Others available are: | |
# :confirmable, :lockable, :timeoutable and :omniauthable | |
devise :database_authenticatable, :registerable, | |
:recoverable, :rememberable, :trackable, :validatable | |
## Database authenticatable | |
field :email, :type => String, :default => "" | |
field :encrypted_password, :type => String, :default => "" | |
## Recoverable | |
field :reset_password_token, :type => String | |
field :reset_password_sent_at, :type => Time | |
## Rememberable | |
field :remember_created_at, :type => Time | |
## Trackable | |
field :sign_in_count, :type => Integer, :default => 0 | |
field :current_sign_in_at, :type => Time | |
field :last_sign_in_at, :type => Time | |
field :current_sign_in_ip, :type => String | |
field :last_sign_in_ip, :type => String | |
## Confirmable | |
# field :confirmation_token, :type => String | |
# field :confirmed_at, :type => Time | |
# field :confirmation_sent_at, :type => Time | |
# field :unconfirmed_email, :type => String # Only if using reconfirmable | |
## Lockable | |
# field :failed_attempts, :type => Integer, :default => 0 # Only if lock strategy is :failed_attempts | |
# field :unlock_token, :type => String # Only if unlock strategy is :email or :both | |
# field :locked_at, :type => Time | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FactoryGirl.define do | |
factory :user do | |
email 'test@test.com' | |
password 'testing' | |
password_confirmation 'testing' | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
#system | |
gem 'rails', '4.0.1' | |
gem 'mongoid', github: 'mongoid/mongoid' | |
#admin | |
gem 'devise', github: 'plataformatec/devise' | |
#sass | |
gem 'sass-rails', '~> 4.0.0' | |
gem 'compass-rails' | |
gem 'font-awesome-sass' | |
#js | |
gem 'uglifier', '>= 1.3.0' | |
gem 'coffee-rails', '~> 4.0.0' | |
gem 'jquery-rails' | |
gem 'jbuilder', '~> 1.2' | |
#html | |
gem 'turbolinks' | |
gem 'slim' | |
#markdown transformations | |
gem 'redcarpet' | |
gem 'github-markdown' | |
#image uploads | |
gem 'mongoid-paperclip', :require => 'mongoid_paperclip', :github => 'meskyanichi/mongoid-paperclip' | |
gem 'aws-sdk', '~> 1.3.4', :require => 'aws-sdk' | |
gem 'fog' | |
gem 'unf' | |
group :development, :test do | |
gem 'rspec' | |
gem 'rspec-rails' | |
gem 'guard-rspec' | |
gem 'spork', '>= 1.0rc0' | |
gem 'spork-rails', github: 'A-gen/spork-rails' | |
gem 'guard-spork' | |
gem 'database_cleaner' | |
gem 'factory_girl_rails' | |
gem 'shoulda-matchers' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'spork' | |
require 'factory_girl' | |
Spork.prefork do | |
# 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' | |
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } | |
RSpec.configure do |config| | |
config.infer_base_class_for_anonymous_controllers = false | |
config.order = "random" | |
config.expect_with :stdlib | |
config.before(:suite) do | |
DatabaseCleaner[:mongoid].strategy = :truncation | |
DatabaseCleaner[:mongoid].clean_with(:truncation) | |
end | |
config.before(:each) do | |
DatabaseCleaner.start | |
end | |
config.after(:each) do | |
DatabaseCleaner.clean | |
end | |
end | |
end | |
Spork.each_run do | |
# This code will be run each time you run your specs. | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe User do | |
before { @user = FactoryGirl.create(:user) } | |
it "should have an email" do | |
@user.should respond_to(:email) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The error I get is:
"undefined method 'respond_to' for #Rspec::Core::ExampleGroup::Nested_3:0x000...