Project

General

Profile

« Previous | Next » 

Revision 30ef8b6f

Added by Shlomi Zadok over 8 years ago

Fixes #12004, #11999 - Remove reserved words from Environment friendly_id

Restores use of friendly_id, but removes 'new', 'edit' etc from the
reserved words list to ensure they can be used as identifiers.

Reverts the id-name parameterization to purely name, which fixes
related bugs that caused the parameter value to be used as a Puppet
environment name in class imports, rather than the resource name.

(cherry picked from commit eb8d0ff5fc76002f568bbb94eced10ca6b8b36a9)

View differences:

test/functional/api/v2/environments_controller_test.rb
get :show, { :id => environments(:production).to_param }
assert_response :success
show_response = ActiveSupport::JSON.decode(@response.body)
assert !show_response.empty?
refute show_response.empty?
end
test "should show environment by id or name" do
get :show, { :id => environments(:production).id }
assert_response :success
get :show, { :id => environments(:production).to_param }
assert_response :success
get :show, { :id => environments(:production).name }
assert_response :success
end
test "should create environment" do

Also available in: Unified diff