spec/unit/session_serialisation_spec.rb in gds-sso-15.0.0 vs spec/unit/session_serialisation_spec.rb in gds-sso-15.0.1

- old
+ new

@@ -1,7 +1,7 @@ -require 'spec_helper' -require 'active_record' +require "spec_helper" +require "active_record" describe Warden::SessionSerializer do class SerializableUser include GDS::SSO::User end @@ -33,19 +33,19 @@ end end describe "deserialize a user" do it "should return the user if the timestamp is current and a Time" do - expect(SerializableUser).to receive(:where).with(:uid => 1234, :remotely_signed_out => false).and_return(double(:first => :a_user)) + expect(SerializableUser).to receive(:where).with(uid: 1234, remotely_signed_out: false).and_return(double(first: :a_user)) result = @serializer.deserialize [1234, Time.now.utc - GDS::SSO::Config.auth_valid_for + 3600] expect(result).to equal(:a_user) end it "should return the user if the timestamp is current and is an ISO 8601 string" do - expect(SerializableUser).to receive(:where).with(:uid => 1234, :remotely_signed_out => false).and_return(double(:first => :a_user)) + expect(SerializableUser).to receive(:where).with(uid: 1234, remotely_signed_out: false).and_return(double(first: :a_user)) result = @serializer.deserialize [1234, (Time.now.utc - GDS::SSO::Config.auth_valid_for + 3600).iso8601] expect(result).to equal(:a_user) end @@ -67,10 +67,10 @@ end it "should return nil for a user with a badly formatted timestamp" do expect(SerializableUser).not_to receive(:where) - result = @serializer.deserialize [1234, 'this is not a timestamp'] + result = @serializer.deserialize [1234, "this is not a timestamp"] expect(result).to be_nil end end end