Sha256: afcf5837efd84dc81eb07a10d46d4401db5d84c4d001a8d5fb0902c2795e0147

Contents?: true

Size: 1.06 KB

Versions: 26

Compression:

Stored size: 1.06 KB

Contents

# encoding: utf-8
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 #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 = OrderWalkthrough.up_to(:delivery)
        allow(controller).to receive_messages current_order: order
      end

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

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
spree_frontend-3.3.0.rc1 spec/controllers/spree/checkout_controller_with_views_spec.rb
spree_frontend-3.1.5 spec/controllers/spree/checkout_controller_with_views_spec.rb
spree_frontend-3.2.1 spec/controllers/spree/checkout_controller_with_views_spec.rb
spree_frontend-3.2.0 spec/controllers/spree/checkout_controller_with_views_spec.rb
spree_frontend-3.1.4 spec/controllers/spree/checkout_controller_with_views_spec.rb
spree_frontend-3.2.0.rc3 spec/controllers/spree/checkout_controller_with_views_spec.rb
spree_frontend-3.2.0.rc2 spec/controllers/spree/checkout_controller_with_views_spec.rb
spree_frontend-3.2.0.rc1 spec/controllers/spree/checkout_controller_with_views_spec.rb
spree_frontend-3.1.3 spec/controllers/spree/checkout_controller_with_views_spec.rb
spree_frontend-3.1.2 spec/controllers/spree/checkout_controller_with_views_spec.rb
spree_frontend-3.0.10 spec/controllers/spree/checkout_controller_with_views_spec.rb
spree_frontend-3.1.1 spec/controllers/spree/checkout_controller_with_views_spec.rb
spree_frontend-3.1.0 spec/controllers/spree/checkout_controller_with_views_spec.rb
spree_frontend-3.1.0.rc4 spec/controllers/spree/checkout_controller_with_views_spec.rb
spree_frontend-3.0.9 spec/controllers/spree/checkout_controller_with_views_spec.rb
spree_frontend-3.1.0.rc3 spec/controllers/spree/checkout_controller_with_views_spec.rb
spree_frontend-3.1.0.rc2 spec/controllers/spree/checkout_controller_with_views_spec.rb
spree_frontend-3.1.0.rc1 spec/controllers/spree/checkout_controller_with_views_spec.rb
spree_frontend-3.0.8 spec/controllers/spree/checkout_controller_with_views_spec.rb
spree_frontend-3.0.7 spec/controllers/spree/checkout_controller_with_views_spec.rb