Skip to content

Commit b6963e6

Browse files
authored
Merge pull request #406 from codeRIT/hm-405
fix: Allows optional assets to be unset
2 parents 57098dc + 21e1c01 commit b6963e6

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

app/controllers/manage/configs_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def update
1717
value = params[:hackathon_config][key]
1818
value = true if value == "true"
1919
value = false if value == "false"
20-
if @config.var.end_with?("_asset") && !value.start_with?('http://', 'https://')
20+
if @config.var.start_with?("agreement_") && !value.start_with?('http://', 'https://')
2121
flash[:alert] = "Config \"#{key}\" must start with http:// or https://"
2222
render :edit
2323
elsif @config.value != value

test/controllers/manage/configs_controller_test.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,6 @@ class Manage::ConfigsControllerTest < ActionController::TestCase
152152
assert_redirected_to manage_configs_path
153153
end
154154

155-
should "not update logo_asset with an asset that is not URL based" do
156-
HackathonConfig["logo_asset"] = ""
157-
patch :update, params: { id: "logo_asset", hackathon_config: { logo_asset: "test" } }
158-
assert_equal "", HackathonConfig["logo_asset"]
159-
assert_template :edit
160-
end
161-
162155
should "update config CSS variables when custom_css is blank" do
163156
HackathonConfig["custom_css"] = ""
164157
patch :update, params: { id: "custom_css", hackathon_config: { custom_css: ":root {\n --foo: #fff;\n}" } }

0 commit comments

Comments
 (0)