Sha256: 1fef5292bd0707adec6ed182f3eb7d71de411a3ff117766d71dec271965ef32e

Contents?: true

Size: 1.12 KB

Versions: 33

Compression:

Stored size: 1.12 KB

Contents

# frozen_string_literal: true

require 'spec_helper'

# This spec is useful for when we just want to make sure a view is rendering correctly
# Walking through the entire checkout process is rather tedious, don't you think?
describe Spree::CheckoutController, type: :controller do
  render_views
  let(:token) { 'some_token' }
  let(:user) { stub_model(Spree::LegacyUser) }

  before do
    allow(controller).to receive_messages try_spree_current_user: user
  end

  # Regression test for https://github.com/spree/spree/issues/3246
  context "when using GBP" do
    before do
      Spree::Config[:currency] = "GBP"
    end

    context "when order is in delivery" do
      before do
        # Using a let block won't acknowledge the currency setting
        # Therefore we just do it like this...
        order = Spree::TestingSupport::OrderWalkthrough.up_to(:address)
        allow(controller).to receive_messages current_order: order
      end

      it "displays rate cost in correct currency" do
        get :edit
        html = Nokogiri::HTML(response.body)
        expect(html.css('.rate-cost').text).to eq "£10.00"
      end
    end
  end
end

Version data entries

33 entries across 33 versions & 2 rubygems

Version Path
solidus_frontend-2.8.6 spec/controllers/spree/checkout_controller_with_views_spec.rb
solidus_frontend-2.6.6 spec/controllers/spree/checkout_controller_with_views_spec.rb
solidus_frontend-2.7.4 spec/controllers/spree/checkout_controller_with_views_spec.rb
solidus_frontend-2.8.5 spec/controllers/spree/checkout_controller_with_views_spec.rb
solidus_frontend-2.7.3 spec/controllers/spree/checkout_controller_with_views_spec.rb
solidus_frontend-2.6.5 spec/controllers/spree/checkout_controller_with_views_spec.rb
solidus_frontend-2.8.4 spec/controllers/spree/checkout_controller_with_views_spec.rb
solidus_frontend-2.8.3 spec/controllers/spree/checkout_controller_with_views_spec.rb
solidus_frontend-2.7.2 spec/controllers/spree/checkout_controller_with_views_spec.rb
solidus_frontend-2.6.4 spec/controllers/spree/checkout_controller_with_views_spec.rb
solidus_frontend-2.8.2 spec/controllers/spree/checkout_controller_with_views_spec.rb
solidus_frontend-2.8.1 spec/controllers/spree/checkout_controller_with_views_spec.rb
solidus_frontend-2.6.3 spec/controllers/spree/checkout_controller_with_views_spec.rb
solidus_frontend-2.8.0 spec/controllers/spree/checkout_controller_with_views_spec.rb
solidus_frontend-2.7.1 spec/controllers/spree/checkout_controller_with_views_spec.rb
solidus_frontend-2.6.2 spec/controllers/spree/checkout_controller_with_views_spec.rb
solidus_frontend_devise_token_auth-2.8.0.alpha.14 spec/controllers/spree/checkout_controller_with_views_spec.rb
solidus_frontend_devise_token_auth-2.8.0.alpha.13 spec/controllers/spree/checkout_controller_with_views_spec.rb
solidus_frontend_devise_token_auth-2.8.0.alpha.12 spec/controllers/spree/checkout_controller_with_views_spec.rb
solidus_frontend_devise_token_auth-2.8.0.alpha.11 spec/controllers/spree/checkout_controller_with_views_spec.rb