Skip to content

Commit

Permalink
Fix failing specs
Browse files Browse the repository at this point in the history
  • Loading branch information
alecslupu committed Jul 31, 2024
1 parent 8634bda commit 91bc534
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion decidim-core/spec/lib/decidim_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@
describe ".force_ssl" do
let!(:orig_force_ssl) { described_class.force_ssl }
let(:rails_env) { "test" }
let(:env) { ActiveSupport::EnvironmentInquirer.new(rails_env) }

before do
allow(Rails).to receive(:env).and_return(rails_env)
allow(Rails).to receive(:env).and_return(env)
load "#{Decidim::Core::Engine.root}/lib/decidim/core.rb"
end

Expand Down
4 changes: 3 additions & 1 deletion decidim-core/spec/lib/organization_settings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ module Decidim
let(:maximum_attachment_size) { 20 }

before do
ENV["DECIDIM_MAXIMUM_ATTACHMENT_SIZE"] = maximum_attachment_size
allow(ENV).to receive(:fetch).and_call_original
allow(ENV).to receive(:fetch).with("DECIDIM_MAXIMUM_ATTACHMENT_SIZE", nil).and_return("#{maximum_attachment_size}")

# defaults method is memoized, we need to reset it to make sure it uses the stubbed values
described_class.instance_variable_set(:@defaults, nil)
end
Expand Down
3 changes: 2 additions & 1 deletion decidim-core/spec/uploaders/application_uploader_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ module Decidim
before do
allow(Rails.env).to receive(:development?).and_return(false)
allow(Rails.env).to receive(:test?).and_return(false)
ENV["STORAGE_CDN_HOST"] = cdn_host
allow(ENV).to receive(:fetch).and_call_original
allow(ENV).to receive(:fetch).with("STORAGE_CDN_HOST", nil).and_return(cdn_host)
end

it "returns a URL containing the CDN configurations" do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Decidim.configure do |config|
# The name of the application
config.application_name = Decidim::Env.new("DECIDIM_APPLICATION_NAME", "My Application Name").to_json
config.application_name = Decidim::Env.new("DECIDIM_APPLICATION_NAME", "My Application Name").to_s

# The email that will be used as sender in all emails from Decidim
config.mailer_sender = Decidim::Env.new("DECIDIM_MAILER_SENDER", "change-me@example.org").to_s
Expand Down Expand Up @@ -293,12 +293,12 @@
config.etherpad = {
server: ENV.fetch("ETHERPAD_SERVER", nil),
api_key: ENV.fetch("ETHERPAD_API_KEY", nil),
api_version: Decidim::Env.new("ETHERPAD_API_VERSION", "1.2.1")
api_version: Decidim::Env.new("ETHERPAD_API_VERSION", "1.2.1").value
}
end

# Sets Decidim::Exporters::CSV's default column separator
config.default_csv_col_sep = Decidim::Env.new("DECIDIM_DEFAULT_CSV_COL_SEP", ";").to_json
config.default_csv_col_sep = Decidim::Env.new("DECIDIM_DEFAULT_CSV_COL_SEP", ";").value

# The list of roles a user can have, not considering the space-specific roles.
# config.user_roles = %w(admin user_manager)
Expand Down Expand Up @@ -346,7 +346,7 @@
# config.machine_translation_service = "MyTranslationService"

# Defines the social networking services used for social sharing
config.social_share_services = Decidim::Env.new("DECIDIM_SOCIAL_SHARE_SERVICES", "X, Facebook, WhatsApp, Telegram").to_array.to_json
config.social_share_services = Decidim::Env.new("DECIDIM_SOCIAL_SHARE_SERVICES", "X, Facebook, WhatsApp, Telegram").to_array

# Defines the name of the cookie used to check if the user allows Decidim to
# set cookies.
Expand Down

0 comments on commit 91bc534

Please sign in to comment.