Added rspec testing. It should work, but doesn't for unknown reasons
This commit is contained in:
14
spec/routes/index_spec.rb
Normal file
14
spec/routes/index_spec.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
require_relative '../spec_helper'
|
||||
|
||||
RSpec.describe IndexRoutes do
|
||||
|
||||
def app
|
||||
IndexRoutes
|
||||
end
|
||||
|
||||
it "Dashboard returns 200" do
|
||||
get '/'
|
||||
expect(last_response).to be_ok
|
||||
end
|
||||
|
||||
end
|
17
spec/spec_helper.rb
Normal file
17
spec/spec_helper.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
ENV['APP_ENV'] = 'test'
|
||||
|
||||
require_relative '../src/app'
|
||||
require 'rspec'
|
||||
require 'rack/test'
|
||||
|
||||
module RSpecMixin
|
||||
include Rack::Test::Methods
|
||||
|
||||
def app
|
||||
GameData
|
||||
end
|
||||
end
|
||||
|
||||
RSpec.configure do |config|
|
||||
config.include RSpecMixin
|
||||
end
|
Reference in New Issue
Block a user