Skip to content

Instantly share code, notes, and snippets.

@bsylvain
Last active December 26, 2015 20:58
Show Gist options
  • Select an option

  • Save bsylvain/7212243 to your computer and use it in GitHub Desktop.

Select an option

Save bsylvain/7212243 to your computer and use it in GitHub Desktop.
Failures:
1) BrowseFamilleAndGoods selectionne une famille et affiche les produits
Failure/Error: fill_in "Email", :with => user.email
NoMethodError:
undefined method `fill_in' for #<RSpec::Core::ExampleGroup::Nested_1:0xb68dba4c>
# ./spec/requests/browse_famille_and_goods_spec.rb:8:in `block (2 levels) in <top (required)>'
Finished in 1.17 seconds
1 example, 1 failure
require 'rubygems'
require 'spork'
#uncomment the following line to use spork with the debugger
#require 'spork/ext/ruby-debug'
Spork.prefork do
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
#necessaire pour recharger les classes a cause de active admin qui provoque le
#chargement des classes dans la partie "toujours chargée" de spork
require "rails/application"
Spork.trap_method(Rails::Application::RoutesReloader, :reload!) # Rails 3.1
#Fin du hack active admin
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
require 'capybara/rspec'
# 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
# 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.include Devise::TestHelpers, :type => :controller
config.use_transactional_fixtures = false
config.before(:suite) do
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.clean_with(:truncation)
load "#{Rails.root}/db/seeds.rb"
end
config.before(:each) do
DatabaseCleaner.start
end
config.after(:each) do
DatabaseCleaner.clean
end
# 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
end
end
Spork.each_run do
# This code will be run each time you run your specs.
FactoryGirl.reload
end
#encoding: utf-8
require "spec_helper"
describe "BrowseFamilleAndGoods" do
it "selectionne une famille et affiche les produits" do
get root_path
user= FactoryGirl.build(:user)
fill_in "Email", :with => user.email
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment