in invoice mail Show payment method in invoice web view Story Convert story to acceptance criteria Acceptance Criteria Convert acceptance criteria to acceptance tests describe "Subscribe and pay for Premium" it "should show payment method in invoice mail" do subscribe_to_premium_and_pay(user, :pay_with => "Visa") current_email.should have_body_text("Visa") end it "should show payment method in invoice web view" visit invoice_path page.should have_content("Visa") end end Acceptance Tests Unit Tests Create unit tests where appropriate describe "Invoice" it "should have payment method" do user = stub("User") subscription = stub("Subscription") invoice = create_invoice(user, subscription, :pay_with => "Visa") invoice.payment_method.should == "Visa" end end
user needs, requirements, and business processes [...] to determine whether or not to accept the system. [After IEEE 610] • Integration Testing: Testing performed to expose defects in the interfaces and in the interactions between integrated components or systems. • Unit Test: The testing of individual software components. [After IEEE 610] Source: International Software Testing Qualifications Board, Glossary of Testing Terms, www.istqb.org
response is all we have • Test common use cases without getting to low level in your assertions • No mocks or stubs • Test invokes entire stack including web framework, databases, caches, etc.
primarily as a helper for the developer (to drive the design of SUT) • Used in bugfixes to simulate the bug and afterwards as a regression test • Mock and stub collaborators of SUT