spec/lib/appsignal/transaction_spec.rb in appsignal-0.12.rc.12 vs spec/lib/appsignal/transaction_spec.rb in appsignal-0.12.rc.13
- old
+ new
@@ -147,10 +147,23 @@
its([:params_method]) { should == :filtered_params }
end
end
end
+ describe "#store" do
+ it "should return an empty store when it's not already present" do
+ expect( transaction.store('test') ).to eql({})
+ end
+
+ it "should store changes to the store" do
+ transaction_store = transaction.store('test')
+ transaction_store['transaction'] = 'value'
+
+ expect( transaction.store('test') ).to eql({'transaction' => 'value'})
+ end
+ end
+
describe "#set_tags" do
it "should add tags to transaction" do
expect {
transaction.set_tags({'a' => 'b'})
}.to change(transaction, :tags).to({'a' => 'b'})
@@ -325,9 +338,16 @@
transaction.should respond_to(:add_exception)
end
it "should not add the error if it's in the ignored list" do
Appsignal.stub(:is_ignored_error? => true)
+ Appsignal::Extension.should_not_receive(:set_transaction_error)
+
+ transaction.set_error(error)
+ end
+
+ it "should not add the error if appsignal is not active" do
+ Appsignal.stub(:active? => false)
Appsignal::Extension.should_not_receive(:set_transaction_error)
transaction.set_error(error)
end