$ git diff Gemfile diff --git a/api/Gemfile b/api/Gemfile --- a/api/Gemfile +++ b/api/Gemfile @@ -76,6 +76,7 @@ group :test do gem "capybara" gem "selenium-webdriver" gem "webdrivers" + gem "committee-rails" end
1 2 3 4 5 6 7 8 9 10 11
$ docker-compose run --rm api ./bin/bundle install Using devise-i18n 1.10.2 Using devise_token_auth 1.2.1 Installing openapi_parser 0.15.0 Installing json_schema 0.21.0 Fetching committee 4.4.0 Installing committee 4.4.0 Fetching committee-rails 0.6.1 Installing committee-rails 0.6.1 Bundle complete! 29 Gemfile dependencies, 114 gems now installed. Use `bundle info [gemname]` to see where a bundled gem is installed.
RSpec.describe "API::Auth::RegistrationsController", type: :request do describe "POST /api/v1/auth" do it "returns 200" do post "/api/v1/auth", params: { email: "example@example.com" } assert_response_schema_confirm(200) end
it "returns 422" do post "/api/v1/auth", params: { password: "password" } assert_response_schema_confirm(422) end end end
specの実行
では実行します。
1 2 3 4 5 6 7 8 9 10
$ docker-compose run --rm api ./bin/rspec spec/api/v1/auth/registrations_controller_spec.rb
(省略)
Failures: 1) API::Auth::RegistrationsController POST /api/v1/auth return 200 Failure/Error: <p><%= link_to t('.confirm_account_link'), confirmation_url(@resource, {confirmation_token: @token, config: message['client-config'].to_s, redirect_url: message['redirect-url']}).html_safe %></p> ActionView::Template::Error: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true
$ docker-compose run --rm api ./bin/rspec spec/api/v1/auth/registrations_controller_spec.rb
(省略)
API::Auth::RegistrationsController POST /api/v1/auth [DEPRECATION] Committee: please set query_hash_key = rack.request.query_hash because we'll change default value in next major version. [DEPRECATION] Committee: please set parse_response_by_content_type = false because we'll change default value in next major version.