Browse Source

specs

readme
changelog
version
development
Cesidio Di Landa 12 years ago
parent
commit
f070fa45d4
  1. 6
      spec/features/CHANGELOG.md
  2. 9
      spec/features/README.md
  3. 1
      spec/features/VERSION
  4. 8
      spec/features/pages_spec.rb
  5. 56
      spec/spec_helper.rb
  6. 9
      spec/support/mailer_macros.rb

6
spec/features/CHANGELOG.md

@ -0,0 +1,6 @@
Changelog
=========
0.1
---
* First version

9
spec/features/README.md

@ -0,0 +1,9 @@
Starter App
===========
* Ruby 2
* Rails 4
* PostgreSQL
* Twitter Bootstrap
* Heroku
* RSpec

1
spec/features/VERSION

@ -0,0 +1 @@
0.1

8
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

56
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

9
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
Loading…
Cancel
Save