Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Object oriented acceptance testing using personas.
Ruby

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
Gemfile
MIT-LICENSE
README.md
Rakefile
bbq.gemspec

README.md

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 even example usage with EventMachine. Feel free to modify it for your own needs.

Build Status

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

First, add BBQ to your apps Gemfile:

# Gemfile
gem "bbq", "~> 0.0.2.beta.3"

Run install generator:

rails generate bbq:install

Require BBQ in test/test_helper.rb:

require "bbq/test"

Feature generator

rails g bbq:test MyFeatureName

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::Devise
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

bundle install
bundle exec rake test:acceptance # or spec:acceptance for RSpec flavour

Additional information

Maintainers

Contributors

Future plans

License

MIT License

Something went wrong with that request. Please try again.