Skip to content
Object oriented acceptance testing using personas.
Ruby JavaScript
Find file
Pull request Compare This branch is 165 commits behind drugpl:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
script
test
.gitignore
Gemfile
MIT-LICENSE
README.rdoc
Rakefile
bbq.gemspec

README.rdoc

Warning & disclaimer

This gem is currently under development. We're targeting most popular use case - Rails. However the philosophy behind it is not limited to Rails nor web applications in general. There is example usage with EventMachine. Feel free to modify it for your own needs.

BBQ

Object oriented acceptance testing using personas.

  • Ruby

  • OOP

  • DCI (Data Context Interaction) - for roles/personas

  • Test framework independent, based on Capybara

  • Opinionated

Difference from Cucumber

  • No Gherkin

  • Objects and methods instead of steps

  • Easier code reuse

  • No factories/fixtures

Example applications

Installation

gem install bbq

Generators

rails generate bbq:install

Examples

test "admin can browse all user tickets" do
  summaries = ["Forgot my password", "Page is not displayed correctly"]
  descriptions = ["I lost my yellow note with password under the table!",
                  "My IE renders crap instead of crispy fonts!"]

  alice = Roundtrip::TestUser.new
  alice.extend(Roundtrip::TestUser::TicketReporter)
  alice.register_and_login
  alice.open_ticket(summaries.first, descriptions.first)

  bob = Roundtrip::TestUser.new
  bob.extend(Roundtrip::TestUser::TicketReporter)
  bob.register_and_login
  bob.open_ticket(summaries.second, descriptions.second)

  bofh = Roundtrip::TestUser.new(:email => @admin.email)
  bofh.extend(Roundtrip::TestUser::TicketManager)
  bofh.login
  bofh.visit "/support/admin/tickets"
  assert bofh.see?(*summaries)
  bofh.click_on(summaries.second)
  assert bofh.see?(summaries.second, descriptions.second)
  assert bofh.not_see?(summaries.first, descriptions.first)
end

Deal with Devise

require 'bbq/test_user'
require 'bbq/devise'

class TestUser < Bbq::TestUser
  include Bbq::SpicyDevise
end

After that TestUser have login, logout, register, register_and_login methods.

test "user register with devise" do
  user = TestUser.new # or TestUser.new(:email => "email@example.com", :password => "secret")
  user.register_and_login
  user.see?("Stuff after auth")
end

Development environment

cd test/dummy/
rake db:migrate
RAILS_ENV=test rake db:migrate
cd ../..
bundle install
rake test

Additional information

Contributors

Maintainers

Future plans

License

MIT License

Something went wrong with that request. Please try again.