Skip to content

Commit

Permalink
Merge pull request #2 from deseretbook/1.4
Browse files Browse the repository at this point in the history
1.4
  • Loading branch information
ericsaupe authored Oct 17, 2016
2 parents 8708f78 + 66b52bf commit 57e9b67
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 16 deletions.
17 changes: 12 additions & 5 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,20 @@ AllCops:
- '**/install/*'
TargetRubyVersion: 2.3

# Don't require Ruby 2.3 "frozen_string_literal" pragma comment, for now.
Style/FrozenStringLiteralComment:
# Block length was set to 25, we currently don't have a rule for this
BlockLength:
Enabled: false

# Changing this was causing the route not found error in specs
HttpPositionalArguments:
Enabled: false

# Sometimes I believe this reads better
# This also causes spacing issues on multi-line fixes
Style/BracesAroundHashParameters:
# We are OK with html safe in here
OutputSafety:
Enabled: false

# Don't require Ruby 2.3 "frozen_string_literal" pragma comment, for now.
Style/FrozenStringLiteralComment:
Enabled: false

# We use class vars and will have to continue doing so for compatability
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

source 'https://rubygems.org'

gem 'solidus', '~> 1.3.0'
gem 'solidus', '~> 1.4.0'
gem 'deface'

gemspec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Keep up to date with Solidus
def collection
@deleted = (params.key?(:deleted) && params[:deleted] == "on") ? "checked" : ""
@deleted = params.key?(:deleted) && params[:deleted] == "on" ? "checked" : ""

if @deleted.blank?
# We need to get variants_including_master
Expand Down
2 changes: 1 addition & 1 deletion app/models/spree/variant_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def first_option_value
# Returns all option value delivery messages, if present, as a single String.
# Returns nil if no option values have a delivery message.
def option_delivery_messages
dmsg = option_values.map{|ov|
dmsg = option_values.map{ |ov|
msg = ov.delivery_message
msg.present? ? h(msg) : nil
}.compact.uniq.join('. ').html_safe
Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/spree/products_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
let!(:variant) { create(:master_variant, product: product) }

it 'should assign @variant_id if variant_id param is present' do
spree_get :show, id: product.to_param, variant_id: variant.id
get :show, id: product.to_param, variant_id: variant.id
expect(assigns['variant_id'].to_i).to eq(variant.id)
end

Expand All @@ -16,7 +16,7 @@
create(:base_variant, product: product) # this has option values
create(:base_variant, product: product, option_values: [])

spree_get :show, id: product.to_param
get :show, id: product.to_param
expect(assigns['variants'].count).to eq(1)
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/features/admin/products/variant_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@

it 'should go to master variant edit page' do
visit spree.edit_admin_product_variant_path(product, master_variant)
expect(page).to have_text('WEIGHT') # weight only shows on variant edit page
expect(page).to have_text('Weight') # weight only shows on variant edit page
end
end
6 changes: 2 additions & 4 deletions spec/models/spree/variant_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@
product.option_types << first_type
product.option_types << second_type

variant = create(:base_variant, {
product: product,
variant = create(:base_variant, product: product,
option_values: [
create(:option_value, name: 'First Value', option_type: first_type),
create(:option_value, name: 'Second Value', option_type: second_type)
]
})
])

expect(variant.first_option_value.name).to eq('First Value')
expect(variant.first_option_value.option_type.name).to eq('First Type')
Expand Down
2 changes: 1 addition & 1 deletion spree_variant_picker.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'solidus_variant_picker'
s.version = '0.0.1'
s.version = '1.4.0'
s.summary = 'Enhanced variant listing on Spree product pages'
s.description = 'Enhanced variant listing on Spree product pages'
s.required_ruby_version = '>= 1.9.3'
Expand Down

0 comments on commit 57e9b67

Please sign in to comment.