diff --git a/spec/features/CHANGELOG.md b/spec/features/CHANGELOG.md new file mode 100644 index 0000000..fbb1b1d --- /dev/null +++ b/spec/features/CHANGELOG.md @@ -0,0 +1,6 @@ +Changelog +========= + +0.1 +--- +* First version diff --git a/spec/features/README.md b/spec/features/README.md new file mode 100644 index 0000000..707bcdf --- /dev/null +++ b/spec/features/README.md @@ -0,0 +1,9 @@ +Starter App +=========== + +* Ruby 2 +* Rails 4 +* PostgreSQL +* Twitter Bootstrap +* Heroku +* RSpec diff --git a/spec/features/VERSION b/spec/features/VERSION new file mode 100644 index 0000000..49d5957 --- /dev/null +++ b/spec/features/VERSION @@ -0,0 +1 @@ +0.1 diff --git a/spec/features/pages_spec.rb b/spec/features/pages_spec.rb new file mode 100644 index 0000000..0b2d59d --- /dev/null +++ b/spec/features/pages_spec.rb @@ -0,0 +1,8 @@ +require 'spec_helper' + +describe 'Home' do + it "shows Hello World message" do + visit root_path + expect(page).to have_content I18n.t('hello') + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..c21dd5b --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,56 @@ +if ENV['CI'] + require 'coveralls' + Coveralls.wear! 'rails' +end + +unless ENV['DRB'] + require 'simplecov' + SimpleCov.start 'rails' +end + +# 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 } + +require 'webmock/rspec' +require 'capybara/rspec' + +WebMock.disable_net_connect! allow: 'graph.facebook.com', allow_localhost: true + +#Capybara.ignore_hidden_elements = false # testing hidden fields + +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 + # config.mock_with :rspec + + + # 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' + + config.include Delorean + config.include MailerMacros + ActionMailer::Base.perform_deliveries = false + ActionMailer::Base.raise_delivery_errors = false + ActionMailer::Base.delivery_method = :test + + config.before(:each) do + back_to_the_present + reset_email + #load "#{Rails.root}/db/seeds.rb" + end +end diff --git a/spec/support/mailer_macros.rb b/spec/support/mailer_macros.rb new file mode 100644 index 0000000..effba21 --- /dev/null +++ b/spec/support/mailer_macros.rb @@ -0,0 +1,9 @@ +module MailerMacros + def last_email + ActionMailer::Base.deliveries.last + end + + def reset_email + ActionMailer::Base.deliveries = [] + end +end