I'd like to take everyone's temperature. Rails 4 recently accepted a pull request to change the default locations of tests to test/models and test/controllers, giving minitest-rails users a great upgrade path. I also tried to change the "integration" tests to be named "acceptance" but caught some deserved resistance to that. Most don't use current integration tests to drive the implementation of features (ala cucumber). So renaming them isn't a good idea. I think this is correct, and I wondered what it would take to get true acceptance tests built on top of minitest in Rails 4.
I recently read through a presentation by Andy Lindeman and he showed the rspec syntax for acceptance tests. That got me thinking. Is there any interest in a gem built on top of Rails 4 (or minitest-rails for Rails 3) that enabled the following syntax for tests in test/acceptance?
feature "Accounts" do
scenario "new accounts start with a zero balance" do
login_as_depositor
open_new_account
balance_will_be("0.00")
end
protected
def login_as_depositor
@user = users :depositor
visit new_user_session
fill_in user_username, @user.username
click_on :submit
end
def open_new_account
# ...
end
def balance_will_be(balance)
# assert_includes? page.text, "Balance: $#{balance}"
page.text.must_include? "Balance: $#{balance}"
end
end