summaryrefslogtreecommitdiff
path: root/spec/models/commit_spec.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-08-09 17:51:31 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-08-09 17:51:31 +0000
commite09ef2fc38adf76a8986ab3078fe92831bf56836 (patch)
tree10435d41c8dbc8798cb0e18b96372b063b75bebc /spec/models/commit_spec.rb
parentc0e1312567dc09aea0aecd72a3fa777c31b85b50 (diff)
parenta0755d2f051c5a9cd31721333adee22cb40b1008 (diff)
downloadgitlab-ce-e09ef2fc38adf76a8986ab3078fe92831bf56836.tar.gz
Merge branch 'improve-test-env' into 'master'
Improve test env * Replace big gitlabhq repo with small one (https://gitlab.com/gitlab-org/gitlab-test) * dont stub gitlab-shell calls Advantages: * test gitlab-shell install during tests * test integration with gitlab-shell features (fork, change default branch etc) * don't store archive with test repo inside gitlab * less stubs - easier to write/read tests During this refactoring __next issues are be fixed__: * satellite error if gitlab_shell path is relative * project rename repo -> 500 error * fixed wrong diff for MR `download plain diff` * fixed bug when gfm ignores `@ref` variable during link parsing Fixes #1451 See merge request !1005
Diffstat (limited to 'spec/models/commit_spec.rb')
-rw-r--r--spec/models/commit_spec.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb
index d8ab171d3ee..1673184cbe4 100644
--- a/spec/models/commit_spec.rb
+++ b/spec/models/commit_spec.rb
@@ -11,7 +11,7 @@ describe Commit do
end
it "truncates a message without a newline at 80 characters" do
- message = commit.safe_message * 10
+ message = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sodales id felis id blandit. Vivamus egestas lacinia lacus, sed rutrum mauris.'
commit.stub(:safe_message).and_return(message)
commit.title.should == "#{message[0..79]}&hellip;"
@@ -24,11 +24,14 @@ describe Commit do
commit.title.should == message
end
- it "truncates a message with a newline after 80 characters at 70 characters" do
- message = (commit.safe_message * 10) + "\n"
+ it "does not truncates a message with a newline after 80 but less 100 characters" do
+ message =<<eos
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sodales id felis id blandit.
+Vivamus egestas lacinia lacus, sed rutrum mauris.
+eos
commit.stub(:safe_message).and_return(message)
- commit.title.should == "#{message[0..79]}&hellip;"
+ commit.title.should == message.split("\n").first
end
end