diff --git a/README.rdoc b/README.rdoc index 78811e7..e689270 100644 --- a/README.rdoc +++ b/README.rdoc @@ -67,4 +67,8 @@ Before running the specs, add your SalesKing credentials to /spec/settings.yml BUNDLE_GEMFILE=ci/Gemfile_ar3 bundle install BUNDLE_GEMFILE=ci/Gemfile_ar3 bundle exec rake spec + #test with ActiveResource 5 + BUNDLE_GEMFILE=ci/Gemfile_ar5 bundle install + BUNDLE_GEMFILE=ci/Gemfile_ar5 bundle exec rake spec + Copyright (c) 2011-2016 Georg Leciejewski, released under the MIT license diff --git a/ci/Gemfile_ar5 b/ci/Gemfile_ar5 new file mode 100644 index 0000000..5f99fc5 --- /dev/null +++ b/ci/Gemfile_ar5 @@ -0,0 +1,11 @@ +source 'https://rubygems.org' +gem "rake" +gem "rdoc" +gem "activesupport", "5.2" +gem "activeresource", "5.0" +gem "sk_api_schema" +gem "curb" +group :test do + gem "rspec" + gem "simplecov" +end diff --git a/ci/Gemfile_ar5.lock b/ci/Gemfile_ar5.lock new file mode 100644 index 0000000..847c43f --- /dev/null +++ b/ci/Gemfile_ar5.lock @@ -0,0 +1,68 @@ +GEM + remote: https://rubygems.org/ + specs: + activemodel (5.2.0) + activesupport (= 5.2.0) + activemodel-serializers-xml (1.0.2) + activemodel (> 5.x) + activesupport (> 5.x) + builder (~> 3.1) + activeresource (5.0.0) + activemodel (>= 5.0, < 6) + activemodel-serializers-xml (~> 1.0) + activesupport (>= 5.0, < 6) + activesupport (5.2.0) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + builder (3.2.3) + concurrent-ruby (1.0.5) + curb (0.9.6) + diff-lcs (1.3) + docile (1.3.1) + i18n (1.1.0) + concurrent-ruby (~> 1.0) + json (2.1.0) + minitest (5.11.3) + rake (12.3.1) + rdoc (6.0.4) + rspec (3.8.0) + rspec-core (~> 3.8.0) + rspec-expectations (~> 3.8.0) + rspec-mocks (~> 3.8.0) + rspec-core (3.8.0) + rspec-support (~> 3.8.0) + rspec-expectations (3.8.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.8.0) + rspec-mocks (3.8.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.8.0) + rspec-support (3.8.0) + simplecov (0.16.1) + docile (~> 1.1) + json (>= 1.8, < 3) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.2) + sk_api_schema (0.11.0) + activesupport + thread_safe (0.3.6) + tzinfo (1.2.5) + thread_safe (~> 0.1) + +PLATFORMS + ruby + +DEPENDENCIES + activeresource (= 5.0) + activesupport (= 5.2) + curb + rake + rdoc + rspec + simplecov + sk_api_schema + +BUNDLED WITH + 1.16.0 diff --git a/lib/sk_sdk/base.rb b/lib/sk_sdk/base.rb index fcd55c9..befb513 100644 --- a/lib/sk_sdk/base.rb +++ b/lib/sk_sdk/base.rb @@ -71,7 +71,7 @@ def self.site_api_url(site) # Unfortunately only using AR v4+ we can create additional accessors # to get info on collection info and links - if ActiveResource::VERSION::MAJOR == 4 + if [4,5].include?(ActiveResource::VERSION::MAJOR) class SkCollection < ActiveResource::Collection attr_accessor :current_page, :per_page, :total_entries, :total_pages diff --git a/spec/sk_sdk/resources/payment_spec.rb b/spec/sk_sdk/resources/payment_spec.rb index de1d9ac..5550962 100644 --- a/spec/sk_sdk/resources/payment_spec.rb +++ b/spec/sk_sdk/resources/payment_spec.rb @@ -77,8 +77,4 @@ end - def destroy_payment - - end - end diff --git a/spec/sk_sdk/resources/product_spec.rb b/spec/sk_sdk/resources/product_spec.rb index eff2468..8b557d3 100644 --- a/spec/sk_sdk/resources/product_spec.rb +++ b/spec/sk_sdk/resources/product_spec.rb @@ -44,13 +44,6 @@ product.name.should == @product.name end - it "should edit a product" do - @product.name = 'A new product name' - @product.lock_version.should == 0 - @product.save - @product.lock_version.should == 1 # because save returns the data - end - it "should fail edit a product" do @product.name = '' @product.save.should == false