summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2017-02-13 18:05:02 +0000
committerRobert Speicher <robert@gitlab.com>2017-02-13 18:05:02 +0000
commitda8577675843ea01e183bf07a635386e94514665 (patch)
treefeb8a79efe2d71f9ad602e41cc1287f64edce60b /spec/models
parent2fcc1f7e9eeb1cadbc264f4ae731f317f7581bc1 (diff)
parent948e1b845cd93c6450794379282712ec3b4a9caf (diff)
downloadgitlab-ce-da8577675843ea01e183bf07a635386e94514665.tar.gz
Merge branch 'dm-quick-fix-web-edit-new-lines' into 'master'
Respect autocrlf setting when creating/updating file through web UI Closes gitlab-com/www-gitlab-com#1152 See merge request !9198
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/repository_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb
index 9bfa6409607..838fd3754b2 100644
--- a/spec/models/repository_spec.rb
+++ b/spec/models/repository_spec.rb
@@ -351,6 +351,17 @@ describe Repository, models: true do
expect(blob.data).to eq('Changelog!')
end
+ it 'respects the autocrlf setting' do
+ repository.commit_file(user, 'hello.txt', "Hello,\r\nWorld",
+ message: 'Add hello world',
+ branch_name: 'master',
+ update: true)
+
+ blob = repository.blob_at('master', 'hello.txt')
+
+ expect(blob.data).to eq("Hello,\nWorld")
+ end
+
context "when an author is specified" do
it "uses the given email/name to set the commit's author" do
expect do