spec/appsignal_spec.rb in appsignal-0.6.3.beta.2 vs spec/appsignal_spec.rb in appsignal-0.6.3.beta.3

- old
+ new

@@ -12,9 +12,31 @@ Appsignal.agent.should_receive(:enqueue).with(transaction) subject end end + describe ".tag_request" do + before { Appsignal::Transaction.stub(:current => transaction) } + + context "with transaction" do + let(:transaction) { double } + + it "should call set_tags on transaction" do + transaction.should_receive(:set_tags).with({'a' => 'b'}) + end + + after { Appsignal.tag_request({'a' => 'b'}) } + end + + context "without transaction" do + let(:transaction) { nil } + + it "should call set_tags on transaction" do + Appsignal.tag_request.should be_false + end + end + end + describe ".transactions" do subject { Appsignal.transactions } it { should be_a Hash } end