actions/_share: add telegram
This commit is contained in:
parent
4ee2b46b32
commit
0451e2fedd
|
@ -5,5 +5,8 @@
|
||||||
%a.dropdown-item{ href: tumblr_share_url(answer), target: "_blank" }
|
%a.dropdown-item{ href: tumblr_share_url(answer), target: "_blank" }
|
||||||
%i.fa.fa-fw.fa-tumblr
|
%i.fa.fa-fw.fa-tumblr
|
||||||
= t(".tumblr")
|
= t(".tumblr")
|
||||||
|
%a.dropdown-item{ href: telegram_share_url(answer), target: "_blank" }
|
||||||
|
%i.fa.fa-fw.fa-telegram
|
||||||
|
= t(".telegram")
|
||||||
%a.dropdown-item{ href: "#", name: "ab-share" }
|
%a.dropdown-item{ href: "#", name: "ab-share" }
|
||||||
= t(".other")
|
= t(".other")
|
||||||
|
|
|
@ -81,6 +81,7 @@ en:
|
||||||
share:
|
share:
|
||||||
twitter: "Share on Twitter"
|
twitter: "Share on Twitter"
|
||||||
tumblr: "Share on Tumblr"
|
tumblr: "Share on Tumblr"
|
||||||
|
telegram: "Share on Telegram"
|
||||||
other: "Share on other apps..."
|
other: "Share on other apps..."
|
||||||
admin:
|
admin:
|
||||||
announcement:
|
announcement:
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require "rails_helper"
|
||||||
|
|
||||||
|
describe "actions/_share.html.haml", type: :view do
|
||||||
|
let(:answer) { FactoryBot.create(:answer, user: FactoryBot.create(:user)) }
|
||||||
|
|
||||||
|
subject(:rendered) do
|
||||||
|
render partial: "actions/share", locals: {
|
||||||
|
answer:,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
it "has a dropdown item to share to twitter" do
|
||||||
|
expect(rendered).to have_css(%(a.dropdown-item[href^="https://twitter.com/"][target="_blank"]))
|
||||||
|
end
|
||||||
|
|
||||||
|
it "has a dropdown item to share to tumblr" do
|
||||||
|
expect(rendered).to have_css(%(a.dropdown-item[href^="https://www.tumblr.com/"][target="_blank"]))
|
||||||
|
end
|
||||||
|
|
||||||
|
it "has a dropdown item to share to telegram" do
|
||||||
|
expect(rendered).to have_css(%(a.dropdown-item[href^="https://t.me/"][target="_blank"]))
|
||||||
|
end
|
||||||
|
|
||||||
|
it "has a dropdown item to share to anywhere else" do
|
||||||
|
expect(rendered).to have_css(%(a.dropdown-item[name="ab-share"]))
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue