Commit c17383a7 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Improvements to user organization field feature after code review

* Add newline to user organization spec according to test guide
* Remove unnecessary comments from user organization database migration
Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent d0b556eb
...@@ -4,25 +4,8 @@ ...@@ -4,25 +4,8 @@
class AddOrganizationToUser < ActiveRecord::Migration class AddOrganizationToUser < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers include Gitlab::Database::MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME = false DOWNTIME = false
# When a migration requires downtime you **must** uncomment the following
# constant and define a short and easy to understand explanation as to why the
# migration requires downtime.
# DOWNTIME_REASON = ''
# When using the methods "add_concurrent_index" or "add_column_with_default"
# you must disable the use of transactions as these methods can not run in an
# existing transaction. When using "add_concurrent_index" make sure that this
# method is the _only_ method called in the migration, any other changes
# should go in a separate migration. This ensures that upon failure _only_ the
# index creation fails and can be retried or reverted easily.
#
# To disable transactions uncomment the following line and remove these
# comments:
# disable_ddl_transaction!
def change def change
add_column :users, :organization, :string add_column :users, :organization, :string
end end
......
...@@ -267,6 +267,7 @@ describe API::API, api: true do ...@@ -267,6 +267,7 @@ describe API::API, api: true do
it "updates user with organization" do it "updates user with organization" do
put api("/users/#{user.id}", admin), { organization: 'GitLab' } put api("/users/#{user.id}", admin), { organization: 'GitLab' }
expect(response).to have_http_status(200) expect(response).to have_http_status(200)
expect(json_response['organization']).to eq('GitLab') expect(json_response['organization']).to eq('GitLab')
expect(user.reload.organization).to eq('GitLab') expect(user.reload.organization).to eq('GitLab')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment