Sha256: 17f8b8ba22e863ca1cb9c3bda47c1363a9e759aa41f16e45d95fbd04c9ff2048

Contents?: true

Size: 563 Bytes

Versions: 47

Compression:

Stored size: 563 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

shared_examples "localised email" do
  let(:user) { build(:user, locale: locale) }

  context "when the user has a custom locale" do
    let(:locale) { "ca" }

    it "uses the user's locale" do
      expect(mail.subject).to eq(subject)
      expect(mail.body.encoded).to match(body)
    end
  end

  context "otherwise" do
    let(:locale) { nil }

    it "uses the default locale" do
      expect(mail.subject).to eq(default_subject)
      expect(mail.body.encoded).to match(default_body)
    end
  end
end

Version data entries

47 entries across 47 versions & 2 rubygems

Version Path
decidim-core-0.10.1 lib/decidim/core/test/shared_examples/localised_email.rb
decidim-core-0.10.0 lib/decidim/core/test/shared_examples/localised_email.rb
decidim-core-0.9.3 lib/decidim/core/test/shared_examples/localised_email.rb
decidim-core-0.9.2 lib/decidim/core/test/shared_examples/localised_email.rb
decidim-core-0.9.1 lib/decidim/core/test/shared_examples/localised_email.rb
decidim-core-0.9.0 lib/decidim/core/test/shared_examples/localised_email.rb
decidim-core-0.8.4 lib/decidim/core/test/shared_examples/localised_email.rb
decidim-core-0.8.3 lib/decidim/core/test/shared_examples/localised_email.rb
decidim-core-0.8.2 lib/decidim/core/test/shared_examples/localised_email.rb
decidim-core-0.8.1 lib/decidim/core/test/shared_examples/localised_email.rb
decidim-core-0.8.0 lib/decidim/core/test/shared_examples/localised_email.rb
decidim-core-0.7.4 lib/decidim/core/test/shared_examples/localised_email.rb
decidim-core-0.7.3 lib/decidim/core/test/shared_examples/localised_email.rb
decidim-core-0.7.2 lib/decidim/core/test/shared_examples/localised_email.rb
decidim-core-0.7.1 lib/decidim/core/test/shared_examples/localised_email.rb
decidim-core-0.7.0 lib/decidim/core/test/shared_examples/localised_email.rb
decidim-core-0.6.8 lib/decidim/core/test/shared_examples/localised_email.rb
decidim-0.6.8 decidim-core/lib/decidim/core/test/shared_examples/localised_email.rb
decidim-core-0.6.7 lib/decidim/core/test/shared_examples/localised_email.rb
decidim-0.6.7 decidim-core/lib/decidim/core/test/shared_examples/localised_email.rb