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.6.6 lib/decidim/core/test/shared_examples/localised_email.rb
decidim-0.6.6 decidim-core/lib/decidim/core/test/shared_examples/localised_email.rb
decidim-core-0.6.5 lib/decidim/core/test/shared_examples/localised_email.rb
decidim-0.6.5 decidim-core/lib/decidim/core/test/shared_examples/localised_email.rb
decidim-core-0.6.4 lib/decidim/core/test/shared_examples/localised_email.rb
decidim-0.6.4 decidim-core/lib/decidim/core/test/shared_examples/localised_email.rb
decidim-core-0.6.3 lib/decidim/core/test/shared_examples/localised_email.rb
decidim-0.6.3 decidim-core/lib/decidim/core/test/shared_examples/localised_email.rb
decidim-core-0.6.2 lib/decidim/core/test/shared_examples/localised_email.rb
decidim-0.6.2 decidim-core/lib/decidim/core/test/shared_examples/localised_email.rb
decidim-core-0.6.1 lib/decidim/core/test/shared_examples/localised_email.rb
decidim-0.6.1 decidim-core/lib/decidim/core/test/shared_examples/localised_email.rb
decidim-core-0.6.0 lib/decidim/core/test/shared_examples/localised_email.rb
decidim-0.6.0 decidim-core/lib/decidim/core/test/shared_examples/localised_email.rb
decidim-core-0.5.1 lib/decidim/core/test/shared_examples/localised_email.rb
decidim-0.5.1 decidim-core/lib/decidim/core/test/shared_examples/localised_email.rb
decidim-core-0.5.0 lib/decidim/core/test/shared_examples/localised_email.rb
decidim-0.5.0 decidim-core/lib/decidim/core/test/shared_examples/localised_email.rb
decidim-core-0.4.4 lib/decidim/core/test/shared_examples/localised_email.rb
decidim-core-0.4.2 lib/decidim/core/test/shared_examples/localised_email.rb