22 lines
349 B
Ruby
22 lines
349 B
Ruby
ENV["APP_ENV"] = "test"
|
|
|
|
require "./app"
|
|
require "rspec"
|
|
require "rack/test"
|
|
|
|
describe "Toy App" do
|
|
include Rack::Test::Methods
|
|
|
|
def app
|
|
Sinatra::Application
|
|
end
|
|
|
|
context "test /" do
|
|
it "test root route" do
|
|
get "/"
|
|
expect(last_response).to be_ok
|
|
expect(last_response.body).to eq("hello there!\n")
|
|
end
|
|
end
|
|
end
|