diff --git a/.ruby-version b/.ruby-version index 47b322c..f989260 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.4.1 +3.4.4 diff --git a/spec/supplejack/concept_spec.rb b/spec/supplejack/concept_spec.rb index 7f16699..3c01cda 100644 --- a/spec/supplejack/concept_spec.rb +++ b/spec/supplejack/concept_spec.rb @@ -113,7 +113,7 @@ module Supplejack it 'requests the concept from the API' do allow(SupplejackConcept).to receive(:get).with('/concepts/1', {}).and_return('concept' => {}) - SupplejackConcept.find(1) + expect(SupplejackConcept.find(1)).not_to be_nil end it 'initializes a new SupplejackConcept object' do @@ -128,7 +128,7 @@ module Supplejack allow(Supplejack).to receive(:fields).and_return(%i[verbose default]) allow(SupplejackConcept).to receive(:get).with('/concepts/1', {}).and_return('concept' => {}) - SupplejackConcept.find(1) + expect(SupplejackConcept.find(1)).not_to be_nil end end end @@ -137,7 +137,7 @@ module Supplejack it 'calls the get method' do allow(SupplejackConcept).to receive(:get).with('/concepts', {}).and_return({}) - SupplejackConcept.all + expect(SupplejackConcept.all).not_to be_nil end end end diff --git a/spec/supplejack/controllers/helpers_spec.rb b/spec/supplejack/controllers/helpers_spec.rb index 06bb952..a1846fd 100644 --- a/spec/supplejack/controllers/helpers_spec.rb +++ b/spec/supplejack/controllers/helpers_spec.rb @@ -60,7 +60,7 @@ module Controllers controller.search end - it 'tries to initialize with params[:search] ' do + it 'tries to initialize with params[:search]' do allow(controller).to receive(:params).and_return({ search: { text: 'cat' } }) expect(Supplejack::Search).to receive(:new).with({ text: 'cat' }) @@ -100,7 +100,7 @@ module Controllers it 'correctly uses the translation for the label' do allow(I18n).to receive(:t).with('supplejack_user_sets.user.name', default: 'User.name').and_return('By') - controller.attribute(user_set, 'user.name') + expect(controller.attribute(user_set, 'user.name')).not_to be_nil end end @@ -132,11 +132,11 @@ module Controllers end it 'doesn\'t display content_partner' do - expect(controller.attribute(record, :content_partner)).to be nil + expect(controller.attribute(record, :content_partner)).to be_nil end it 'doesn\'t display description' do - expect(controller.attribute(record, :description)).to be nil + expect(controller.attribute(record, :description)).to be_nil end it 'displays span label tag' do @@ -150,7 +150,7 @@ module Controllers it 'uses the translation key' do allow(I18n).to receive(:t).with('item.key', default: 'Title').and_return('Title') - controller.attribute(record, :title, trans_key: 'item.key') + expect(controller.attribute(record, :title, trans_key: 'item.key')).not_to be_nil end context 'when :link => true' do @@ -175,14 +175,14 @@ module Controllers end it 'returns nothing when value is nil' do - expect(controller.attribute(record, :description, link: true)).to be nil + expect(controller.attribute(record, :description, link: true)).to be_nil end end it 'returns nothing when value is "Not specified"' do record = mock_record(description: 'Not specified') - expect(controller.attribute(record, :description)).to be nil + expect(controller.attribute(record, :description)).to be_nil end it 'adds extra_html inside of the

' do @@ -265,7 +265,7 @@ module Controllers end it 'returns nothing when both values are nil' do - expect(controller.attribute(record, %i[object_url source], link: true)).to be nil + expect(controller.attribute(record, %i[object_url source], link: true)).to be_nil end end end @@ -298,8 +298,8 @@ module Controllers end it 'displays the next and previous links' do - allow(controller).to receive(:previous_record_link).and_return('') - allow(controller).to receive(:next_record_link).and_return('') + allow(controller).to receive_messages(previous_record_link: '', + next_record_link: '') expect(controller.next_previous_links(record)).to eq %(<a class="next" href="/records/37674826?search%5Bpath%5D=items&amp;search%5Btext%5D=Forest+fire">Next result</a>) end diff --git a/spec/supplejack/item_relation_spec.rb b/spec/supplejack/item_relation_spec.rb index 6ddfef7..5eb5f8c 100644 --- a/spec/supplejack/item_relation_spec.rb +++ b/spec/supplejack/item_relation_spec.rb @@ -82,13 +82,13 @@ module Supplejack allow(relation).to receive(:build).and_return(item) expect(item).to receive(:save) - relation.create + expect(relation.create).not_to be_nil end it 'passes the parameters along to the build method' do allow(relation).to receive(:build).with({ record_id: 8, position: 3 }).and_return(item) - relation.create({ record_id: 8, position: 3 }) + expect(relation.create({ record_id: 8, position: 3 })).not_to be_nil end end diff --git a/spec/supplejack/item_spec.rb b/spec/supplejack/item_spec.rb index 13f0c55..33057ef 100644 --- a/spec/supplejack/item_spec.rb +++ b/spec/supplejack/item_spec.rb @@ -93,13 +93,13 @@ module Supplejack it 'returns nil when the date is not in the correct format' do item = described_class.new(date: ['afsdfgsdfg']) - expect(item.date).to be nil + expect(item.date).to be_nil end end describe '#method_missing' do it 'returns nil for any unknown attribute' do - expect(described_class.new.non_existent_method).to be nil + expect(described_class.new.non_existent_method).to be_nil end end end diff --git a/spec/supplejack/log_subscriber_spec.rb b/spec/supplejack/log_subscriber_spec.rb index 7aa42fe..20dc385 100644 --- a/spec/supplejack/log_subscriber_spec.rb +++ b/spec/supplejack/log_subscriber_spec.rb @@ -7,7 +7,7 @@ module Supplejack it 'returns nil when logging not enabled' do allow(Supplejack).to receive(:enable_logging).and_return(false) - expect(described_class.new.log_request(1, {})).to be nil + expect(described_class.new.log_request(1, {})).to be_nil end end end diff --git a/spec/supplejack/more_like_this_record_spec.rb b/spec/supplejack/more_like_this_record_spec.rb index eb71c92..b22a54b 100644 --- a/spec/supplejack/more_like_this_record_spec.rb +++ b/spec/supplejack/more_like_this_record_spec.rb @@ -63,7 +63,7 @@ module Supplejack { 'more_like_this' => { 'record' => {} } } ) - more_like_this.records + expect(more_like_this.records).not_to be_nil end context 'when record not found' do diff --git a/spec/supplejack/paginated_collection_spec.rb b/spec/supplejack/paginated_collection_spec.rb index 628c3bd..093a454 100644 --- a/spec/supplejack/paginated_collection_spec.rb +++ b/spec/supplejack/paginated_collection_spec.rb @@ -12,7 +12,7 @@ it { expect(collection.total_pages).to eq 2 } it { expect(collection.current_page).to eq 1 } it { expect(collection.per_page).to eq 10 } - it { expect(collection.previous_page).to be nil } + it { expect(collection.previous_page).to be_nil } it { expect(collection.next_page).to eq 2 } it { expect(collection.out_of_bounds?).not_to be true } it { expect(collection.offset).to eq 0 } diff --git a/spec/supplejack/record_spec.rb b/spec/supplejack/record_spec.rb index 7748187..aaddf99 100644 --- a/spec/supplejack/record_spec.rb +++ b/spec/supplejack/record_spec.rb @@ -188,7 +188,7 @@ module Supplejack it 'requests the record from the API' do allow(SupplejackRecord).to receive(:get).with('/records/1', { fields: 'default' }).and_return({ 'record' => {} }) - SupplejackRecord.find(1) + expect(SupplejackRecord.find(1)).not_to be_nil end it 'initializes a new SupplejackRecord object' do @@ -203,13 +203,13 @@ module Supplejack allow(Supplejack).to receive(:fields).and_return(%i[verbose default]) allow(SupplejackRecord).to receive(:get).with('/records/1', { fields: 'verbose,default' }).and_return({ 'record' => {} }) - SupplejackRecord.find(1) + expect(SupplejackRecord.find(1)).not_to be_nil end it 'sets the correct search options' do allow(SupplejackRecord).to receive(:get).with('/records/1', hash_including(search: hash_including({ text: 'dog' }))).and_return({ 'record' => {} }) - SupplejackRecord.find(1, text: 'dog') + expect(SupplejackRecord.find(1, text: 'dog')).not_to be_nil end context 'when using a special search klass' do @@ -220,7 +220,7 @@ module Supplejack allow(Supplejack).to receive(:search_klass).and_return('Search') allow(::Search).to receive(:new).with({ i: { location: 'Wellington' } }).and_return(search) - SupplejackRecord.find(1, i: { location: 'Wellington' }) + expect(SupplejackRecord.find(1, { i: { location: 'Wellington' } })).not_to be_nil end it 'uses the default search klass' do @@ -228,21 +228,21 @@ module Supplejack allow(Supplejack).to receive(:search_klass).and_return(nil) allow(Supplejack::Search).to receive(:new).with({ i: { location: 'Wellington' } }).and_return(search) - SupplejackRecord.find(1, { i: { location: 'Wellington' } }) + expect(SupplejackRecord.find(1, { i: { location: 'Wellington' } })).not_to be_nil end it 'sends the params from the subclassed search to the API' do allow(Supplejack).to receive(:search_klass).and_return('Search') allow(SupplejackRecord).to receive(:get).with('/records/1', hash_including(search: hash_including({ and: { name: 'John' }, or: { type: ['Person'] } }))).and_return('record' => {}) - SupplejackRecord.find(1, i: { name: 'John' }) + expect(SupplejackRecord.find(1, { i: { name: 'John' } })).not_to be_nil end it 'sends any changes to the api_params made on the subclassed search object' do allow(Supplejack).to receive(:search_klass).and_return('SpecialSearch') allow(SupplejackRecord).to receive(:get).with('/records/1', hash_including(search: hash_including(and: {}))).and_return('record' => {}) - SupplejackRecord.find(1, i: { format: 'Images' }) + expect(SupplejackRecord.find(1, { i: { format: 'Images' } })).not_to be_nil end end end @@ -251,7 +251,7 @@ module Supplejack it 'sends a request to /records/multiple endpoint with an array of record ids' do allow(SupplejackRecord).to receive(:get).with('/records/multiple', { record_ids: [1, 2], fields: 'default' }).and_return({ 'records' => [] }) - SupplejackRecord.find([1, 2]) + expect(SupplejackRecord.find([1, 2])).not_to be_nil end it 'initializes multiple SupplejackRecord objects' do @@ -266,7 +266,7 @@ module Supplejack allow(Supplejack).to receive(:fields).and_return(%i[verbose description]) allow(SupplejackRecord).to receive(:get).with('/records/multiple', { record_ids: [1, 2], fields: 'verbose,description' }).and_return({ 'records' => [] }) - SupplejackRecord.find([1, 2]) + expect(SupplejackRecord.find([1, 2])).not_to be_nil end end end diff --git a/spec/supplejack/request_spec.rb b/spec/supplejack/request_spec.rb index 2b24eaf..5475ded 100644 --- a/spec/supplejack/request_spec.rb +++ b/spec/supplejack/request_spec.rb @@ -13,9 +13,7 @@ module Supplejack subject(:requester) { Supplejack::TestClass.new } before do - allow(Supplejack).to receive(:api_key).and_return('123') - allow(Supplejack).to receive(:api_url).and_return('http://api.org') - allow(Supplejack).to receive(:timeout).and_return(20) + allow(Supplejack).to receive_messages(api_key: '123', api_url: 'http://api.org', timeout: 20) end describe '#get' do diff --git a/spec/supplejack/search_spec.rb b/spec/supplejack/search_spec.rb index 6378c11..41956a0 100644 --- a/spec/supplejack/search_spec.rb +++ b/spec/supplejack/search_spec.rb @@ -75,7 +75,7 @@ module Supplejack end it 'returns nil when not set' do - expect(described_class.new.sort).to be nil + expect(described_class.new.sort).to be_nil end end @@ -85,7 +85,7 @@ module Supplejack end it 'returns nil when not set' do - expect(described_class.new.direction).to be nil + expect(described_class.new.direction).to be_nil end end @@ -179,14 +179,14 @@ module Supplejack it 'returns nil when facet is not found' do allow(search).to receive(:facets).and_return([]) - expect(search.facet('collection')).to be nil + expect(search.facet('collection')).to be_nil end it 'returns nil if value is nil' do facet = Supplejack::Facet.new('collection', []) allow(search).to receive(:facets) { [facet] } - expect(search.facet(nil)).to be nil + expect(search.facet(nil)).to be_nil end end @@ -239,13 +239,13 @@ module Supplejack end describe '#results' do - let(:search) { described_class.new } - let(:record1) { { 'id' => 1, 'title' => 'Wellington' } } - let(:record2) { { 'id' => 2, 'title' => 'Auckland' } } + let(:search) { described_class.new } + let(:recordone) { { 'id' => 1, 'title' => 'Wellington' } } + let(:recordtwo) { { 'id' => 2, 'title' => 'Auckland' } } before do allow(Supplejack).to receive(:record_klass).and_return('TestRecord') - search.instance_variable_set(:@response, 'search' => { 'result_count' => 2, 'results' => [record1, record2] }) + search.instance_variable_set(:@response, 'search' => { 'result_count' => 2, 'results' => [recordone, recordtwo] }) end it 'executes the request only once' do @@ -264,18 +264,18 @@ module Supplejack end it 'initializes record objects with the default class' do - expect(TestRecord).to receive(:new).with(record1) - expect(TestRecord).to receive(:new).with(record2) + expect(TestRecord).to receive(:new).with(recordone) + expect(TestRecord).to receive(:new).with(recordtwo) search.results end it 'initializes record objects with the class provided in the params' do search = described_class.new(record_klass: 'test_item') - search.instance_variable_set(:@response, 'search' => { 'results' => [record1, record2] }) + search.instance_variable_set(:@response, 'search' => { 'results' => [recordone, recordtwo] }) - expect(TestItem).to receive(:new).with(record1) - expect(TestItem).to receive(:new).with(record2) + expect(TestItem).to receive(:new).with(recordone) + expect(TestItem).to receive(:new).with(recordtwo) search.results end @@ -580,7 +580,7 @@ module Supplejack it 'returns false when location has nil value' do search.location = nil - expect(search.has_category?('Cats')).to be nil + expect(search.has_category?('Cats')).to be_nil end it 'search for onlu existent search attribute' do @@ -608,10 +608,10 @@ module Supplejack it 'removes category filter from the search request' do allow(search).to receive(:get).with('/records', hash_including(and: { year: 2001 })).and_return('search' => { 'facets' => { 'category' => { 'Books' => 123 } } }) - search.categories + expect(search.categories).not_to be_nil end - it 'returns the category facet hash ' do + it 'returns the category facet hash' do expect(search.categories).to include('Books' => 123) end @@ -653,7 +653,7 @@ module Supplejack expect(search.fetch_facet_values('category')['All']).to eq 223 end - it 'doesnt return the All count ' do + it 'doesnt return the All count' do expect(search.fetch_facet_values('category', all: false)).not_to have_key('All') end diff --git a/spec/supplejack/story_item_relation_spec.rb b/spec/supplejack/story_item_relation_spec.rb index b7c6bb5..0f43475 100644 --- a/spec/supplejack/story_item_relation_spec.rb +++ b/spec/supplejack/story_item_relation_spec.rb @@ -96,13 +96,13 @@ module Supplejack it 'passes the parameters along to the build method' do allow(relation).to receive(:build).with({ type: 'embed' }).and_return(item) - relation.create({ type: 'embed' }) + expect(relation.create({ type: 'embed' })).not_to be_nil end end context 'when items are arrays' do it 'executes array methods on the @items array' do - expect(relation.any? { |x| x.id == 1 }).to eq(true) + expect(relation.any? { |x| x.id == 1 }).to be(true) end it 'iterates through the items relation' do diff --git a/spec/supplejack/story_item_spec.rb b/spec/supplejack/story_item_spec.rb index 628afaa..6425fc2 100644 --- a/spec/supplejack/story_item_spec.rb +++ b/spec/supplejack/story_item_spec.rb @@ -6,7 +6,7 @@ module Supplejack describe StoryItem do describe '#initialize' do it 'accepts a hash of attributes' do - described_class.new(type: 'embed', sub_type: 'supplejack_user') + expect(described_class.new(type: 'embed', sub_type: 'supplejack_user')).not_to be_nil end it 'accepts a hash with string keys' do @@ -27,11 +27,11 @@ module Supplejack describe '#save' do let(:item) { described_class.new(type: 'embed', sub_type: 'supplejack_user', story_id: '1234', api_key: 'abc') } - context 'when item is new ' do + context 'when item is new' do it 'triggers a POST request to create a story_item with the story api_key' do expect(item).to receive(:post).with('/stories/1234/items', { user_key: 'abc' }, story_item: { meta: {}, type: 'embed', sub_type: 'supplejack_user' }) - expect(item.save).to eq(true) + expect(item.save).to be(true) end end @@ -40,7 +40,7 @@ module Supplejack item.id = 1 expect(item).to receive(:patch).with('/stories/1234/items/1', { user_key: 'abc' }, story_item: { meta: {}, type: 'embed', sub_type: 'supplejack_user' }) - expect(item.save).to eq(true) + expect(item.save).to be(true) end end @@ -48,7 +48,7 @@ module Supplejack before { allow(item).to receive(:post).and_raise(RestClient::Forbidden.new) } it 'returns false when an HTTP error is raised' do - expect(item.save).to eq(false) + expect(item.save).to be(false) end it 'stores the error when a error is raised' do @@ -72,7 +72,7 @@ module Supplejack before { allow(item).to receive(:delete).and_raise(RestClient::Forbidden.new) } it 'returns false when a HTTP error is raised' do - expect(item.destroy).to eq(false) + expect(item.destroy).to be(false) end it 'stores the error when a error is raised' do diff --git a/spec/supplejack/story_spec.rb b/spec/supplejack/story_spec.rb index 88725d6..a951be9 100644 --- a/spec/supplejack/story_spec.rb +++ b/spec/supplejack/story_spec.rb @@ -99,41 +99,41 @@ module Supplejack describe '#private?' do it 'returns true when the privacy is private' do - expect(described_class.new(privacy: 'private').private?).to eq true + expect(described_class.new(privacy: 'private').private?).to be true end it 'returns false when the privacy is something else' do - expect(described_class.new(privacy: 'public').private?).to eq false + expect(described_class.new(privacy: 'public').private?).to be false end end describe '#public?' do it 'returns false when the privacy is private' do - expect(described_class.new(privacy: 'private').public?).to eq false + expect(described_class.new(privacy: 'private').public?).to be false end it 'returns true when the privacy is public' do - expect(described_class.new(privacy: 'public').public?).to eq true + expect(described_class.new(privacy: 'public').public?).to be true end end describe '#hidden?' do it 'returns false when the privacy is not hidden' do - expect(described_class.new(privacy: 'public').hidden?).to eq false + expect(described_class.new(privacy: 'public').hidden?).to be false end it 'returns true when the privacy is hidden' do - expect(described_class.new(privacy: 'hidden').hidden?).to eq true + expect(described_class.new(privacy: 'hidden').hidden?).to be true end end describe '#new_record?' do it "returns true when the user_set doesn't have a id" do - expect(described_class.new.new_record?).to eq true + expect(described_class.new.new_record?).to be true end it 'returns false when the user_set has a id' do - expect(described_class.new(id: '1234abc').new_record?).to eq false + expect(described_class.new(id: '1234abc').new_record?).to be false end end @@ -169,7 +169,7 @@ module Supplejack end it 'triggers a POST request to /stories.json' do - expect(story.save).to eq true + expect(story.save).to be true end it 'stores the id of the user_set' do @@ -188,7 +188,7 @@ module Supplejack RSpec::Mocks.space.proxy_for(described_class).reset allow(described_class).to receive(:post).and_raise(RestClient::Forbidden.new) - expect(story.save).to eq false + expect(story.save).to be false end end @@ -321,13 +321,13 @@ module Supplejack it 'executes a delete request to the API with the user set api_key' do expect(described_class).to receive(:delete).with('/stories/999', user_key: 'keysome') - expect(story.destroy).to eq(true) + expect(story.destroy).to be(true) end it 'returns false when the response is not a 200' do allow(described_class).to receive(:delete).and_raise(RestClient::Forbidden.new) - expect(story.destroy).to eq(false) + expect(story.destroy).to be(false) expect(story.errors).to eq 'Forbidden' end @@ -335,7 +335,7 @@ module Supplejack allow(story).to receive(:new_record?).and_return(true) expect(described_class).not_to receive(:delete) - expect(story.destroy).to eq(false) + expect(story.destroy).to be(false) end end @@ -373,31 +373,31 @@ module Supplejack it 'returns true when the Story is public' do story = described_class.new(privacy: 'public') - expect(story.viewable_by?(nil)).to eq(true) + expect(story.viewable_by?(nil)).to be(true) end it 'returns true when the user_set is hidden' do story = described_class.new(privacy: 'hidden') - expect(story.viewable_by?(nil)).to eq(true) + expect(story.viewable_by?(nil)).to be(true) end context 'when set is private' do let(:story) { described_class.new(privacy: 'private', user:) } it 'returns false when the user is not present' do - expect(story.viewable_by?(nil)).to eq(false) + expect(story.viewable_by?(nil)).to be(false) end it 'returns true when the user has the same api_key as the user_set' do - expect(story.viewable_by?(Supplejack::User.new(user))).to eq(true) + expect(story.viewable_by?(Supplejack::User.new(user))).to be(true) end it 'returns false if both the api_key in the user and the set are nil' do user = { api_key: nil } story = described_class.new(privacy: 'private', user:) - expect(story.viewable_by?(Supplejack::User.new(user))).to eq(false) + expect(story.viewable_by?(Supplejack::User.new(user))).to be(false) end end end @@ -410,15 +410,15 @@ module Supplejack let(:nil_api_key_story) { described_class.new(user: { api_key: nil }) } it "returns true when the users api_key is the same as the set's" do - expect(users_story.owned_by?(user)).to eq(true) + expect(users_story.owned_by?(user)).to be(true) end it 'returns false when the set and user have different api_keys' do - expect(other_story.owned_by?(user)).to eq(false) + expect(other_story.owned_by?(user)).to be(false) end it 'returns false when both keys are nil' do - expect(nil_api_key_story.owned_by?(user)).to eq(false) + expect(nil_api_key_story.owned_by?(user)).to be(false) end end @@ -508,7 +508,7 @@ module Supplejack it 'fetches the Story from the API' do allow(described_class).to receive(:get).with('/stories/123abc', {}).and_return(attributes) - described_class.find('123abc') + expect(described_class.find('123abc')).not_to be_nil end it 'initializes a Story object' do diff --git a/spec/supplejack/user_set_spec.rb b/spec/supplejack/user_set_spec.rb index 9c90980..f4a1701 100644 --- a/spec/supplejack/user_set_spec.rb +++ b/spec/supplejack/user_set_spec.rb @@ -156,8 +156,7 @@ module Supplejack let(:attributes) { { name: 'Dogs', description: 'hi', count: 3 } } before do - allow(supplejack_set).to receive(:api_attributes).and_return(attributes) - allow(supplejack_set).to receive(:api_key).and_return('123abc') + allow(supplejack_set).to receive_messages(api_attributes: attributes, api_key: '123abc') end context 'when user_set is a new_record' do @@ -245,7 +244,7 @@ module Supplejack it 'sets nil when the time is incorrect' do supplejack_set.send("#{attr}=", '838927587hdfhsjdf') - expect(supplejack_set.send(attr)).to be nil + expect(supplejack_set.send(attr)).to be_nil end it 'accepts a Time object too' do @@ -295,8 +294,7 @@ module Supplejack describe '#destroy' do before do - allow(supplejack_set).to receive(:api_key).and_return('123abc') - allow(supplejack_set).to receive(:id).and_return('999') + allow(supplejack_set).to receive_messages(api_key: '123abc', id: '999') end it 'executes a delete request to the API with the user set api_key' do @@ -337,7 +335,7 @@ module Supplejack supplejack_set.items supplejack_set.reload - expect(supplejack_set.instance_variable_get('@items')).to be nil + expect(supplejack_set.instance_variable_get('@items')).to be_nil end end @@ -408,7 +406,7 @@ module Supplejack end it 'returns nil if the set doesn\'t have a record' do - expect(supplejack_set.set_record_id).to be nil + expect(supplejack_set.set_record_id).to be_nil end end diff --git a/spec/supplejack/user_spec.rb b/spec/supplejack/user_spec.rb index 40aa5dd..08f322e 100644 --- a/spec/supplejack/user_spec.rb +++ b/spec/supplejack/user_spec.rb @@ -106,7 +106,7 @@ module Supplejack it 'returns a nil authentication_token' do expect(user.api_attributes).to have_key(:authentication_token) - expect(user.api_attributes[:authentication_token]).to be nil + expect(user.api_attributes[:authentication_token]).to be_nil end end diff --git a/supplejack_client.gemspec b/supplejack_client.gemspec index 3a8e8a3..a37880e 100644 --- a/supplejack_client.gemspec +++ b/supplejack_client.gemspec @@ -3,7 +3,7 @@ require File.expand_path('lib/supplejack/version', __dir__) Gem::Specification.new do |spec| - spec.required_ruby_version = '>= 3.2.2' + spec.required_ruby_version = '>= 3.4.4' spec.authors = ['Supplejack'] spec.email = ['info@digitalnz.org'] spec.description = ' Library to abstract the interaction with the Supplejack API ' @@ -24,5 +24,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'pry', '~> 0.14.1' spec.add_development_dependency 'rspec', '~> 3.10' spec.add_development_dependency 'rubocop', '~> 1.22', '>= 1.22.1' - spec.add_development_dependency 'rubocop-rspec', '~> 2.4' + spec.add_development_dependency 'rubocop-capybara', '~> 2.2' + spec.add_development_dependency 'rubocop-rspec', '~> 3.0' end