Created
August 22, 2011 14:08
-
-
Save MrJaba/1162460 to your computer and use it in GitHub Desktop.
Scenario Blueprints
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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