Skip to content

Instantly share code, notes, and snippets.

@MrJaba
Created August 22, 2011 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save MrJaba/1162460 to your computer and use it in GitHub Desktop.
Save MrJaba/1162460 to your computer and use it in GitHub Desktop.
Scenario Blueprints
#In test file
setup do
load_scenario("bookshop_a")
end
test "Franks has 5 books" do
assert_equal 5, @frank.books.count
end
#In test helper or some other such solution
def load_scenario(scenario_name)
create(:bookshop_owner, name:"Frank")
create(:bookshop, name: "A lotta books")
create_list(5, :books)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment