Skip to content

Commit

Permalink
Merge pull request #1 from dangerdogz/development
Browse files Browse the repository at this point in the history
Fix failing tests (most of them), get basic features working with Solidus
  • Loading branch information
tvdeyen committed Nov 27, 2015
2 parents 6f16372 + 337f0da commit 42de96e
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ source 'https://rubygems.org'

gemspec

gem 'solidus', github: 'solidusio/solidus', branch: 'master'
gem 'solidus', github: 'solidusio/solidus', branch: 'v1.0'

if ENV['DB'] == 'mysql'
gem 'mysql2', '~> 0.3.20'
Expand Down
6 changes: 3 additions & 3 deletions app/assets/javascripts/spree/backend/translations.js.coffee
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
_.extend Spree.translations,
please_choose_language: "<%= Spree.t(:'i18n.choose_language') %>"

$ ->
_.extend (Spree.translations),
please_choose_language: "<%= Spree.t(:'i18n.choose_language') %>"

$('#available_locales_').select2({placeholder: Spree.translations['please_choose_language']})
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Spree.fetch_cart = ->
$.ajax
url: Spree.pathFor("/cart_link"),
cache: false,
Spree.fetch_cart = (cartLinkUrl) ->
Spree.ajax
url: cartLinkUrl || Spree.pathFor("cart_link"),
success: (data) ->
$('#link-to-cart').html data
$('#link-to-cart').html data
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module Spree
class LocaleController < Spree::StoreController
Spree::LocaleController.class_eval do
def set
redirect_to root_path(locale: params[:switch_to_locale])
end
end
end

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- insert_after '.row .security' -->
<!-- insert_after '[data-hook=admin_general_setting_mail_from_address]'-->
<div class="panel panel-default panel-localization">
<div class="panel-heading">
<h1 class="panel-title">
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- replace_contents '#main-nav-bar' -->
<li id="home-link" data-hook><%= link_to Spree.t(:home), spree.root_path %></li>
<li id="link-to-cart" data-hook>
<noscript>
<%= link_to Spree.t(:cart), '/cart' %>
</noscript>
&nbsp;
</li>
<script>Spree.fetch_cart('<%= j cart_link_url %>')</script>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- insert_bottom '#main-nav-bar > .navbar-right' -->
<!-- insert_bottom '#main-nav-bar' -->
<% if SolidusI18n::Config.available_locales.many? %>
<li id="locale-select" data-hook>
<%= form_tag spree.set_locale_path, class: 'navbar-form' do %>
Expand Down
1 change: 1 addition & 0 deletions lib/solidus_i18n.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
require 'solidus_i18n/version'
require 'solidus_i18n/utils'
require 'coffee_script'
require 'deface'
1 change: 1 addition & 0 deletions solidus_i18n.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'kaminari-i18n', '~> 0.3.2'
s.add_runtime_dependency 'routing-filter', '~> 0.5.0'
s.add_runtime_dependency 'solidus_core', '~> 1.0'
s.add_runtime_dependency 'deface', '~> 1.0'

s.add_development_dependency 'byebug'
s.add_development_dependency 'capybara', '~> 2.4.4'
Expand Down
4 changes: 2 additions & 2 deletions spec/features/translations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
end

scenario 'selected translation is applied' do
expect(page).to have_content(Spree.t(:home, locale: 'pt-BR'))
expect(page).to have_content(/#{Spree.t(:home, locale: 'pt-BR')}/i)
end

scenario 'JS cart link is translated' do
expect(page).to have_content(Spree.t(:cart, locale: 'pt-BR'))
expect(page).to have_content(/#{Spree.t(:cart, locale: 'pt-BR')}/i)
end
end
end
Expand Down

0 comments on commit 42de96e

Please sign in to comment.