Sha256: 6913b059f35b55b37e4c0623c959bac2c0fae5cd90ab17e45b001c2e0c60fe50

Contents?: true

Size: 800 Bytes

Versions: 20

Compression:

Stored size: 800 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

module Decidim
  module Proposals
    describe ApplicationHelper do
      describe "humanize_proposal_state" do
        let(:helper) do
          Class.new.tap do |v|
            v.extend(Decidim::Proposals::ApplicationHelper)
          end
        end

        subject { helper.humanize_proposal_state(state) }

        context "when it is accepted" do
          let(:state) { "accepted" }
          it { is_expected.to eq("Accepted") }
        end

        context "when it is rejected" do
          let(:state) { "rejected" }
          it { is_expected.to eq("Rejected") }
        end

        context "when it is nil" do
          let(:state) { nil }
          it { is_expected.to eq("Not answered") }
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
decidim-0.6.8 decidim-proposals/spec/helpers/application_helper_spec.rb
decidim-0.6.7 decidim-proposals/spec/helpers/application_helper_spec.rb
decidim-0.6.6 decidim-proposals/spec/helpers/application_helper_spec.rb
decidim-0.6.5 decidim-proposals/spec/helpers/application_helper_spec.rb
decidim-0.6.4 decidim-proposals/spec/helpers/application_helper_spec.rb
decidim-0.6.3 decidim-proposals/spec/helpers/application_helper_spec.rb
decidim-0.6.2 decidim-proposals/spec/helpers/application_helper_spec.rb
decidim-0.6.1 decidim-proposals/spec/helpers/application_helper_spec.rb
decidim-0.6.0 decidim-proposals/spec/helpers/application_helper_spec.rb
decidim-0.5.1 decidim-proposals/spec/helpers/application_helper_spec.rb
decidim-0.5.0 decidim-proposals/spec/helpers/application_helper_spec.rb
decidim-0.4.4 decidim-proposals/spec/helpers/application_helper_spec.rb
decidim-0.4.3 decidim-proposals/spec/helpers/application_helper_spec.rb
decidim-0.4.2 decidim-proposals/spec/helpers/application_helper_spec.rb
decidim-0.4.1 decidim-proposals/spec/helpers/application_helper_spec.rb
decidim-0.4.0 decidim-proposals/spec/helpers/application_helper_spec.rb
decidim-0.3.2 decidim-proposals/spec/helpers/application_helper_spec.rb
decidim-0.3.1 decidim-proposals/spec/helpers/application_helper_spec.rb
decidim-0.3.0 decidim-proposals/spec/helpers/application_helper_spec.rb
decidim-0.2.0 decidim-proposals/spec/helpers/application_helper_spec.rb