diff options
9 files changed, 21 insertions, 21 deletions
diff --git a/app/views/spree/admin/shared/_no_objects_found.html.erb b/app/views/spree/admin/shared/_no_objects_found.html.erb index 7f53e74..8258e28 100644 --- a/app/views/spree/admin/shared/_no_objects_found.html.erb +++ b/app/views/spree/admin/shared/_no_objects_found.html.erb @@ -1,4 +1,4 @@ -<%= Spree.t(:no_resource, resource: resource.model_name.human.pluralize) %> +<%= I18n.t('spree.no_resource', resource: resource.model_name.human.pluralize) %> <% if can? :create, resource %> - <%= link_to Spree.t(:create_one), new_resource_url %> + <%= link_to I18n.t('spree.create_one'), new_resource_url %> <% end %> diff --git a/app/views/spree/admin/subscriptions/_form.html.erb b/app/views/spree/admin/subscriptions/_form.html.erb index 64c0e80..cff057e 100644 --- a/app/views/spree/admin/subscriptions/_form.html.erb +++ b/app/views/spree/admin/subscriptions/_form.html.erb @@ -7,7 +7,7 @@ <% if new %> <div class="row"> <div class="field twelve columns"> - <%= f.label :user_id, Spree.t(:user), class: "required" %> + <%= f.label :user_id, I18n.t('spree.user'), class: "required" %> <%= f.collection_select :user_id, Spree::User.all, :id, :email, {}, class: "select2 fullwidth" %> </div> diff --git a/app/views/spree/admin/subscriptions/_legacy_form.html.erb b/app/views/spree/admin/subscriptions/_legacy_form.html.erb index 61d3d08..a3e2b9b 100644 --- a/app/views/spree/admin/subscriptions/_legacy_form.html.erb +++ b/app/views/spree/admin/subscriptions/_legacy_form.html.erb @@ -7,7 +7,7 @@ <% if new %> <div class="row"> <div class="field twelve columns"> - <%= f.label :user_id, Spree.t(:user), class: "required" %> + <%= f.label :user_id, I18n.t('spree.user'), class: "required" %> <%= f.collection_select :user_id, Spree::User.all, :id, :email, {}, class: "select2 fullwidth" %> </div> diff --git a/app/views/spree/admin/subscriptions/edit.html.erb b/app/views/spree/admin/subscriptions/edit.html.erb index 6f4389a..436f408 100644 --- a/app/views/spree/admin/subscriptions/edit.html.erb +++ b/app/views/spree/admin/subscriptions/edit.html.erb @@ -1,7 +1,7 @@ <% content_for(:page_title) { t('.title') } %> <% content_for :page_actions do %> - <li><%= button_link_to t('.back'), admin_subscriptions_path %></li> + <li><%= link_to t('.back'), admin_subscriptions_path %></li> <% end %> <% content_for :sidebar_title do %> diff --git a/app/views/spree/admin/subscriptions/index.html.erb b/app/views/spree/admin/subscriptions/index.html.erb index 9589fff..db962a5 100644 --- a/app/views/spree/admin/subscriptions/index.html.erb +++ b/app/views/spree/admin/subscriptions/index.html.erb @@ -5,46 +5,46 @@ <% end %> <% content_for :page_actions do %> - <li><%= button_link_to t('.new_subscription'), new_admin_subscription_path %></li> + <li><%= link_to t('.new_subscription'), new_admin_subscription_path %></li> <% end %> <% content_for :table_filter_title do %> - <%= Spree.t(:search) %> + <%= I18n.t('spree.search') %> <% end %> <% content_for :table_filter do %> <%= search_form_for [:admin, @search] do |f| %> <div class='field-block alpha four columns'> <div class="date-range-filter field"> - <%= label_tag :q_created_at_gt, Spree.t(:date_range) %> + <%= label_tag :q_created_at_gt, I18n.t('spree.date_range') %> <div class="date-range-fields"> - <%= f.text_field :created_at_gt, class: 'datepicker datepicker-from', placeholder: Spree.t(:start) %> + <%= f.text_field :created_at_gt, class: 'datepicker datepicker-from', placeholder: I18n.t('spree.start') %> <span class="range-divider"> <i class="fa fa-arrow-right"></i> </span> - <%= f.text_field :created_at_lt, class: 'datepicker datepicker-to', placeholder: Spree.t(:stop) %> + <%= f.text_field :created_at_lt, class: 'datepicker datepicker-to', placeholder: I18n.t('spree.stop') %> </div> </div> <div class="date-range-filter field"> <%= label_tag :q_actionable_date_gt, SolidusSubscriptions::Subscription.human_attribute_name(:actionable_date) %> <div class="date-range-fields"> - <%= f.text_field :actionable_date_gt, class: 'datepicker datepicker-from', placeholder: Spree.t(:start) %> + <%= f.text_field :actionable_date_gt, class: 'datepicker datepicker-from', placeholder: I18n.t('spree.start') %> <span class="range-divider"> <i class="fa fa-arrow-right"></i> </span> - <%= f.text_field :actionable_date_lt, class: 'datepicker datepicker-to', placeholder: Spree.t(:stop) %> + <%= f.text_field :actionable_date_lt, class: 'datepicker datepicker-to', placeholder: I18n.t('spree.stop') %> </div> </div> </div> <div class="four columns"> <div class="field"> - <%= label_tag :q_state_eq, Spree.t(:status) %> + <%= label_tag :q_state_eq, I18n.t('spree.status') %> <%= f.select :state_eq, SolidusSubscriptions::Subscription.state_machines[:state].states.map {|s| [s.human_name, s.value]}, {include_blank: true}, class: 'select2 fullwidth' %> </div> </div> @@ -83,7 +83,7 @@ <div class="clearfix"></div> <div class="actions filter-actions"> - <div><%= button Spree.t(:filter_results) %></div> + <div><%= button_tag I18n.t('spree.filter_results') %></div> </div> <% end %> <% end %> diff --git a/app/views/spree/admin/subscriptions/new.html.erb b/app/views/spree/admin/subscriptions/new.html.erb index a231f8b..789395e 100644 --- a/app/views/spree/admin/subscriptions/new.html.erb +++ b/app/views/spree/admin/subscriptions/new.html.erb @@ -1,7 +1,7 @@ <% content_for(:page_title) { t('.title') } %> <% content_for :page_actions do %> - <li><%= button_link_to t('.back'), admin_subscriptions_path %></li> + <li><%= link_to t('.back'), admin_subscriptions_path %></li> <% end %> <%= form_for @subscription, url: spree.admin_subscriptions_url, class: "row" do |f| %> diff --git a/spec/controllers/solidus_subscriptions/api/v1/line_items_controller_spec.rb b/spec/controllers/solidus_subscriptions/api/v1/line_items_controller_spec.rb index f6fafb0..71107a8 100644 --- a/spec/controllers/solidus_subscriptions/api/v1/line_items_controller_spec.rb +++ b/spec/controllers/solidus_subscriptions/api/v1/line_items_controller_spec.rb @@ -35,7 +35,7 @@ RSpec.describe SolidusSubscriptions::Api::V1::LineItemsController, type: :contro context "with valid params" do let(:json_body) { JSON.parse(subject.body) } - it { is_expected.to be_success } + it { is_expected.to be_successful } it "returns the updated record" do expect(json_body["quantity"]).to eq 21 end @@ -61,7 +61,7 @@ RSpec.describe SolidusSubscriptions::Api::V1::LineItemsController, type: :contro context "with valid params" do let(:json_body) { JSON.parse(subject.body) } - it { is_expected.to be_success } + it { is_expected.to be_successful } it "returns the updated record" do expect(json_body["quantity"]).to eq 21 end @@ -110,7 +110,7 @@ RSpec.describe SolidusSubscriptions::Api::V1::LineItemsController, type: :contro context "when the order is ours and incomplete" do let(:order) { create :order, user: user } - it { is_expected.to be_success } + it { is_expected.to be_successful } end end end diff --git a/spec/controllers/solidus_subscriptions/api/v1/subscriptions_controller_spec.rb b/spec/controllers/solidus_subscriptions/api/v1/subscriptions_controller_spec.rb index 59daf1c..05f82bc 100644 --- a/spec/controllers/solidus_subscriptions/api/v1/subscriptions_controller_spec.rb +++ b/spec/controllers/solidus_subscriptions/api/v1/subscriptions_controller_spec.rb @@ -17,7 +17,7 @@ RSpec.describe SolidusSubscriptions::Api::V1::SubscriptionsController, type: :co ) end - it { is_expected.to be_success } + it { is_expected.to be_successful } end context "when the subscription belongs to someone else" do @@ -65,7 +65,7 @@ RSpec.describe SolidusSubscriptions::Api::V1::SubscriptionsController, type: :co context 'when the subscription belongs to the user' do let!(:subscription) { create :subscription, :with_line_item, user: user } - it { is_expected.to be_success } + it { is_expected.to be_successful } context 'when the params are not valid' do let(:subscription_params) do diff --git a/spec/models/solidus_subscriptions/checkout_spec.rb b/spec/models/solidus_subscriptions/checkout_spec.rb index b5a4fab..c3a7aa1 100644 --- a/spec/models/solidus_subscriptions/checkout_spec.rb +++ b/spec/models/solidus_subscriptions/checkout_spec.rb @@ -113,7 +113,7 @@ RSpec.describe SolidusSubscriptions::Checkout do end end - if Gem::Specification.all.find{ |gem| gem.name == 'solidus' }.version >= Gem::Version.new('1.4.0') + if Gem::Specification.find_by_name('solidus').version >= Gem::Version.new('1.4.0') context 'Altered checkout flow' do before do @old_checkout_flow = Spree::Order.checkout_flow |