Sha256: d211b0827ca8995966a9f93ba9480e350b9881dd3df6ef9811aa1e50b54ec082

Contents?: true

Size: 631 Bytes

Versions: 40

Compression:

Stored size: 631 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

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

  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 "when the user does not have a custom locale" 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

40 entries across 40 versions & 1 rubygems

Version Path
decidim-core-0.23.6 lib/decidim/core/test/shared_examples/user_localised_email_examples.rb
decidim-core-0.23.5 lib/decidim/core/test/shared_examples/user_localised_email_examples.rb
decidim-core-0.24.0.rc2 lib/decidim/core/test/shared_examples/user_localised_email_examples.rb
decidim-core-0.23.4 lib/decidim/core/test/shared_examples/user_localised_email_examples.rb
decidim-core-0.24.0.rc1 lib/decidim/core/test/shared_examples/user_localised_email_examples.rb
decidim-core-0.23.3 lib/decidim/core/test/shared_examples/user_localised_email_examples.rb
decidim-core-0.23.2 lib/decidim/core/test/shared_examples/user_localised_email_examples.rb
decidim-core-0.23.1 lib/decidim/core/test/shared_examples/user_localised_email_examples.rb
decidim-core-0.23.1.rc1 lib/decidim/core/test/shared_examples/user_localised_email_examples.rb
decidim-core-0.23.0 lib/decidim/core/test/shared_examples/user_localised_email_examples.rb
decidim-core-0.22.0 lib/decidim/core/test/shared_examples/user_localised_email_examples.rb
decidim-core-0.21.0 lib/decidim/core/test/shared_examples/user_localised_email_examples.rb
decidim-core-0.20.1 lib/decidim/core/test/shared_examples/user_localised_email_examples.rb
decidim-core-0.20.0 lib/decidim/core/test/shared_examples/user_localised_email_examples.rb
decidim-core-0.19.1 lib/decidim/core/test/shared_examples/user_localised_email_examples.rb
decidim-core-0.18.1 lib/decidim/core/test/shared_examples/user_localised_email_examples.rb
decidim-core-0.19.0 lib/decidim/core/test/shared_examples/user_localised_email_examples.rb
decidim-core-0.17.2 lib/decidim/core/test/shared_examples/user_localised_email_examples.rb
decidim-core-0.18.0 lib/decidim/core/test/shared_examples/user_localised_email_examples.rb
decidim-core-0.17.1 lib/decidim/core/test/shared_examples/user_localised_email_examples.rb