From 6c699514e138b0f37df0f1d025f2921bcce7fb3f Mon Sep 17 00:00:00 2001 From: wdransfield Date: Wed, 8 Aug 2018 12:07:14 -0600 Subject: [PATCH] Fix lti-advantage gem specs and change activemodel version Test Plan: verify lti-advantage gem specs pass locally and on Jenkins. Change-Id: I8707914ec5dff77b275ddc92c951e8a865925ba5 Reviewed-on: https://gerrit.instructure.com/160124 Reviewed-by: Cody Cutrer Tested-by: Jenkins Product-Review: Cody Cutrer QA-Review: Cody Cutrer --- .../lti-advantage/lib/lti_advantage/messages/jwt_message.rb | 1 + gems/lti-advantage/lti-advantage.gemspec | 2 +- .../lti_advantage/messages/resource_link_request_spec.rb | 6 +++--- gems/lti-advantage/test.sh | 5 +++++ 4 files changed, 10 insertions(+), 4 deletions(-) create mode 100755 gems/lti-advantage/test.sh diff --git a/gems/lti-advantage/lib/lti_advantage/messages/jwt_message.rb b/gems/lti-advantage/lib/lti_advantage/messages/jwt_message.rb index 88a89dab9ba..1b1f2f5f39c 100644 --- a/gems/lti-advantage/lib/lti_advantage/messages/jwt_message.rb +++ b/gems/lti-advantage/lib/lti_advantage/messages/jwt_message.rb @@ -31,6 +31,7 @@ module LtiAdvantage::Messages }.freeze attr_accessor *REQUIRED_CLAIMS + attr_accessor *TYPED_ATTRIBUTES.keys attr_accessor :address, :birthdate, :custom, diff --git a/gems/lti-advantage/lti-advantage.gemspec b/gems/lti-advantage/lti-advantage.gemspec index c0b88ea8daa..37e565a1f2c 100644 --- a/gems/lti-advantage/lti-advantage.gemspec +++ b/gems/lti-advantage/lti-advantage.gemspec @@ -30,7 +30,7 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] spec.add_runtime_dependency 'json-jwt', '~> 1.5' - spec.add_runtime_dependency "activemodel", "~> 5.1.6" + spec.add_runtime_dependency "activemodel", "~> 5.1" spec.add_development_dependency "redcarpet" spec.add_development_dependency "bundler", "~> 1.16" diff --git a/gems/lti-advantage/spec/lti_advantage/messages/resource_link_request_spec.rb b/gems/lti-advantage/spec/lti_advantage/messages/resource_link_request_spec.rb index 7c756a11742..4e78b68df04 100644 --- a/gems/lti-advantage/spec/lti_advantage/messages/resource_link_request_spec.rb +++ b/gems/lti-advantage/spec/lti_advantage/messages/resource_link_request_spec.rb @@ -72,9 +72,9 @@ module LtiAdvantage::Messages context: LtiAdvantage::Claims::Context.new ) message.validate - expect(message.errors.messages[:context]).to match_array [ - { id: ["can't be blank"] } - ] + expect(message.errors.messages[:context].first.messages).to eq( + {:id => ["can't be blank"]} + ) end it 'verifies that "aud" is an array' do diff --git a/gems/lti-advantage/test.sh b/gems/lti-advantage/test.sh new file mode 100755 index 00000000000..bc4ff117381 --- /dev/null +++ b/gems/lti-advantage/test.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -e + +bundle check || bundle install +bundle exec rspec spec