Sha256: df4b5c6b9bc67f568df629d8e2779ec95461414c6066599c5a8555f9dbdb5a92

Contents?: true

Size: 584 Bytes

Versions: 11

Compression:

Stored size: 584 Bytes

Contents

ENV['RAILS_ENV'] = 'test'

require 'rspec/core'

RSpec.describe 'rails', type: :request do
  let(:stdout) { StringIO.new }

  around(:each) do |example|
    original_stdout = $stdout
    $stdout = stdout
    require_relative 'app'
    require 'rspec/rails'
    example.run
    $stdout = original_stdout
  end

  it 'does not log anything to STDOUT when initializing and sets the Hashie logger to the Rails logger' do
    expect(stdout.string).to eq('')
    expect(Hashie.logger).to eq(Rails.logger)
  end

  it 'works' do
    get '/'
    assert_select 'h1', 'Hello, world!'
  end
end

Version data entries

11 entries across 10 versions & 3 rubygems

Version Path
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/hashie-3.6.0/spec/integration/rails/integration_spec.rb
hashie-3.6.0 spec/integration/rails/integration_spec.rb
tdiary-5.0.8 vendor/bundle/gems/hashie-3.5.7/spec/integration/rails/integration_spec.rb
hashie-3.5.7 spec/integration/rails/integration_spec.rb
hashie-3.5.6 spec/integration/rails/integration_spec.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/hashie-3.5.5/spec/integration/rails/integration_spec.rb
tdiary-5.0.5 vendor/bundle/gems/hashie-3.5.5/spec/integration/rails/integration_spec.rb
tdiary-5.0.4 vendor/bundle/gems/hashie-3.5.5/spec/integration/rails/integration_spec.rb
hashie-3.5.5 spec/integration/rails/integration_spec.rb
hashie-3.5.4 spec/integration/rails/integration_spec.rb
hashie-3.5.3 spec/integration/rails/integration_spec.rb