From 1fa6da05e6e7f59e21824d69f38283c50ba0356b Mon Sep 17 00:00:00 2001 From: Genar Trias Ortiz Date: Mon, 23 Sep 2024 16:23:19 +0200 Subject: [PATCH] start testing --- examples/sinatra-pet-shelter/Gemfile | 1 + examples/sinatra-pet-shelter/app_spec.rb | 10 ++++++++-- examples/sinatra-pet-shelter/spec_helper.rb | 3 +++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/examples/sinatra-pet-shelter/Gemfile b/examples/sinatra-pet-shelter/Gemfile index 4fc2c5f..95bc61c 100644 --- a/examples/sinatra-pet-shelter/Gemfile +++ b/examples/sinatra-pet-shelter/Gemfile @@ -9,4 +9,5 @@ gem 'sinatra-contrib' group :development, :test do gem 'pry' gem 'rspec' + gem 'rspec-html-matchers' end diff --git a/examples/sinatra-pet-shelter/app_spec.rb b/examples/sinatra-pet-shelter/app_spec.rb index 1577a39..68853a7 100644 --- a/examples/sinatra-pet-shelter/app_spec.rb +++ b/examples/sinatra-pet-shelter/app_spec.rb @@ -4,7 +4,13 @@ require_relative 'app' describe App do - it 'works' do - # ... + let(:app) { App.new } + + context 'GET /' do + let(:response) { get '/members' } + + it 'returns 200 OK' do + expect(response.status).to eq 200 + end end end diff --git a/examples/sinatra-pet-shelter/spec_helper.rb b/examples/sinatra-pet-shelter/spec_helper.rb index 349e92b..837cdae 100644 --- a/examples/sinatra-pet-shelter/spec_helper.rb +++ b/examples/sinatra-pet-shelter/spec_helper.rb @@ -1,4 +1,7 @@ # frozen_string_literal: true +require 'rspec_html_matchers' + RSpec.configure do |config| + config.include RSpecHtmlMatchers end