Fix tests for emojione

This commit is contained in:
Dmitriy Zaporozhets 2015-03-11 17:52:02 -07:00
parent d2d709a252
commit d6dda952b8
2 changed files with 5 additions and 3 deletions

View file

@ -52,6 +52,8 @@ v 7.9.0 (unreleased)
- Starred projects page at dashboard
- Make email display name configurable
- Improve json validation in hook data
- Use Emoji One
v 7.8.4
- Fix issue_tracker_id substitution in custom issue trackers
- Fix path and name duplication in namespaces

View file

@ -664,19 +664,19 @@ describe GitlabMarkdownHelper do
it "should generate absolute urls for emoji" do
expect(markdown(':smile:')).to(
include(%(src="#{Gitlab.config.gitlab.url}/assets/emoji/smile.png))
include(%(src="#{Gitlab.config.gitlab.url}/assets/emoji/#{Emoji.emoji_filename('smile')}.png))
)
end
it "should generate absolute urls for emoji if relative url is present" do
allow(Gitlab.config.gitlab).to receive(:url).and_return('http://localhost/gitlab/root')
expect(markdown(":smile:")).to include("src=\"http://localhost/gitlab/root/assets/emoji/smile.png")
expect(markdown(":smile:")).to include("src=\"http://localhost/gitlab/root/assets/emoji/#{Emoji.emoji_filename('smile')}.png")
end
it "should generate absolute urls for emoji if asset_host is present" do
allow(Gitlab::Application.config).to receive(:asset_host).and_return("https://cdn.example.com")
ActionView::Base.any_instance.stub_chain(:config, :asset_host).and_return("https://cdn.example.com")
expect(markdown(":smile:")).to include("src=\"https://cdn.example.com/assets/emoji/smile.png")
expect(markdown(":smile:")).to include("src=\"https://cdn.example.com/assets/emoji/#{Emoji.emoji_filename('smile')}.png")
end