Acceptance Tests?

159 views
Skip to first unread message

Mike Moore

unread,
Oct 22, 2012, 11:39:53 AM10/22/12
to minites...@googlegroups.com
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

http://alindeman.github.com/acceptance_testing/#/28

Diwa Laksh

unread,
Oct 23, 2012, 5:55:56 AM10/23/12
to minites...@googlegroups.com
+1 for this.


In fact, there is a simple minispec implementation available at https://github.com/Erol/fillet/blob/master/lib/fillet.rb
It would be great if this can be natively provided by minitest as acceptance DSL in addition to the test and spec style it offers.

Luca G. Soave

unread,
May 11, 2013, 4:49:51 AM5/11/13
to minites...@googlegroups.com
+1 for minitest as acceptance DSL

Mike Moore

unread,
May 11, 2013, 8:27:21 AM5/11/13
to minites...@googlegroups.com
This is in minitest-rails-capybara now. 


--
-- You received this message because you are subscribed to the Google Groups minitest-rails group. To post to this group, send email to minites...@googlegroups.com. To unsubscribe from this group, send email to minitest-rail...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/minitest-rails?hl=en
---
You received this message because you are subscribed to the Google Groups "minitest-rails" group.
To unsubscribe from this group and stop receiving emails from it, send an email to minitest-rail...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages