Permalink
Browse files

handle "_" for trashed cards

  • Loading branch information...
1 parent f41e481 commit 8f823be102869706f45fb02ea3c694656f50825f @xithan xithan committed Jan 10, 2017
@@ -7,6 +7,7 @@ def fetch_nested_card cardish, opts={}
case cardish
when Card then cardish
when Symbol, Integer then Card.fetch cardish
+ when "_", "_self" then card.context_card
else
opts[:nest_name] = cardish.to_s
Card.fetch cardish, new: nest_new_args(opts)
@@ -170,9 +170,23 @@
end
describe "#send_change_notice" do
- it "send multipart email" do
- skip
- # pending
+ subject(:mail) do
+ Card[:follower_notification_email].format.render_mail(
+ context: Card.fetch("A", look_in_trash: true),
+ to: "joe@user.com",
+ follower: Card["Joe User"],
+ followed_set: Card[:all],
+ follow_option: Card[:always]
+ )
+ end
+
+ it "works for deleted card" do
+ delete "A"
+ expect(mail.subject).to eq 'Joe User deleted "A"'
+ end
+
+ it "sends multipart email" do
+ expect(mail.content_type).to include("multipart/alternative")
end
context "denied access" do
@@ -4,16 +4,16 @@
let(:cache_key) do
"a-Card::Format::HtmlFormat-normal-home_view:content;"\
- "nest_name:A;nest_syntax:A;view:contentcontent:show"
+ "nest_name:A;nest_syntax:A|content;view:contentcontent:show"
end
subject { Card::Cache[Card::View] }
it "can be changed with nest option" do
is_expected.to receive(:fetch).with cache_key
- render_content "{{A}}"
+ render_content "{{A|content}}"
is_expected.not_to receive(:fetch)
- render_content "{{A|content;cache:never}}"
+ render_content "{{A|cache:never}}"
end
end
end

0 comments on commit 8f823be

Please sign in to comment.