summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-09-27 13:19:12 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-09-27 13:20:37 +0300
commitb16f52e6c231000b2f38ef2c3cceaad26fb90b56 (patch)
treeeb41bad89e0d901d5013d4e5133272ee462e4f6e
parentabc97a587d853d6c2ac2a6181e5d811c210fd402 (diff)
downloadgitlab-ce-dz-profile-organization.tar.gz
Improvements to user organization field feature after code reviewdz-profile-organization
* Add newline to user organization spec according to test guide * Remove unnecessary comments from user organization database migration Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r--db/migrate/20160926145521_add_organization_to_user.rb17
-rw-r--r--spec/requests/api/users_spec.rb1
2 files changed, 1 insertions, 17 deletions
diff --git a/db/migrate/20160926145521_add_organization_to_user.rb b/db/migrate/20160926145521_add_organization_to_user.rb
index 987ddfa4c17..e0bef6e7548 100644
--- a/db/migrate/20160926145521_add_organization_to_user.rb
+++ b/db/migrate/20160926145521_add_organization_to_user.rb
@@ -4,25 +4,8 @@
class AddOrganizationToUser < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
- # Set this constant to true if this migration requires downtime.
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
add_column :users, :organization, :string
end
diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb
index e11dbfef591..c5a1cdf8c32 100644
--- a/spec/requests/api/users_spec.rb
+++ b/spec/requests/api/users_spec.rb
@@ -267,6 +267,7 @@ describe API::API, api: true do
it "updates user with organization" do
put api("/users/#{user.id}", admin), { organization: 'GitLab' }
+
expect(response).to have_http_status(200)
expect(json_response['organization']).to eq('GitLab')
expect(user.reload.organization).to eq('GitLab')