Skip to content

Commit

Permalink
move Rack::Test::Methods to spec_helper
Browse files Browse the repository at this point in the history
  • Loading branch information
aamyot authored and aamyot committed Jul 6, 2015
1 parent ad7ebf8 commit e7a09cb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 0 additions & 2 deletions spec/challenges/portfolio_challenge_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
require './app/yose'
require 'rack/test'

describe "Portfolio Challenge" do
include Rack::Test::Methods

def app
Yose.new
Expand Down
4 changes: 1 addition & 3 deletions spec/challenges/prime_factors_challenge_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
require './app/yose'
require 'rack/test'

describe "Prime Factors Challenge" do
include Rack::Test::Methods

def app
Yose.new
Expand Down Expand Up @@ -45,7 +43,7 @@ def app
end

it "validates that the input is lower than 1 000 000" do
get "http://localhost:9292/primeFactors/primeFactors?number=1000001"
get "/primeFactors/primeFactors?number=1000001"

expect(last_response.status).to eq(200)
expect(last_response.content_type).to eq("application/json")
Expand Down
2 changes: 0 additions & 2 deletions spec/challenges/start_challenge_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
require './app/yose'
require 'rack/test'

describe "Start Challenge" do
include Rack::Test::Methods

def app
Yose.new
Expand Down
4 changes: 4 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@
#
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
require 'coveralls'
require 'rack/test'


Coveralls.wear!

RSpec.configure do |config|
config.include Rack::Test::Methods
# rspec-expectations config goes here. You can use an alternate
# assertion/expectation library such as wrong or the stdlib/minitest
# assertions if you prefer.
Expand Down

0 comments on commit e7a09cb

Please sign in to comment.