diff options
author | Mark Fletcher <mark@gitlab.com> | 2016-12-30 13:26:30 +0000 |
---|---|---|
committer | Mark Fletcher <mark@gitlab.com> | 2017-02-14 11:16:34 +0530 |
commit | 109e8ef4485fb45f0a50690e732ee2b9c6e910b0 (patch) | |
tree | 15dd62b3ef2655fe819e2d2de126999ac3f3d092 /spec/models/wiki_page_spec.rb | |
parent | 865e3fcc13834a1503b8a6c3f7cc7826bacdcc9f (diff) | |
download | gitlab-ce-109e8ef4485fb45f0a50690e732ee2b9c6e910b0.tar.gz |
Make WikiPage comparable according to StaticModel interface
* Add WikiPage#id method returning associated SHA for wiki page commit
Diffstat (limited to 'spec/models/wiki_page_spec.rb')
-rw-r--r-- | spec/models/wiki_page_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/models/wiki_page_spec.rb b/spec/models/wiki_page_spec.rb index 579ebac7afb..753dc938c52 100644 --- a/spec/models/wiki_page_spec.rb +++ b/spec/models/wiki_page_spec.rb @@ -318,6 +318,19 @@ describe WikiPage, models: true do end end + describe '#==' do + let(:original_wiki_page) { create(:wiki_page) } + + it 'returns true for identical wiki page' do + expect(original_wiki_page).to eq(original_wiki_page) + end + + it 'returns false for updated wiki page' do + updated_wiki_page = original_wiki_page.update("Updated content") + expect(original_wiki_page).not_to eq(updated_wiki_page) + end + end + private def remove_temp_repo(path) |