Context: I'm trying to use BDD in a Ruby on Rails environment using Capybara / Steak for integration tests, so this will be an example that I use, but this question is a general question about BDD best practices.
Let's say I have a (admittedly wide) user story:
Feature:
As an administrator
I should be able to manage my products
I looked at the gem ActiveAdminfor Rails 3, which allows you to create complex admin interfaces using simple DSL. Although the potential for saving time is huge, it also scares me to disable so much functionality for third-party code without testing at all.
However, I was taught that you usually only need to check the code that you write yourself. So, by this logic, I just need to check that it is ActiveAdminintegrated correctly, as this is the only code that I actually write. The main scenario to verify this may be:
Scenario:
Given I have 20 products
When I visit the product index page
Then I should see 20 products.
This is a feature offered ActiveAdminout of the box. Therefore, I could do a basic installation and create the “Product Administration” page using the documentation ActiveAdmin, and the script will pass.
Of course, then I also integrated a huge number of other scenarios, such as:
Given I have 20 products
And my products include Apples, Bananas, and Berries
When I sort my products by name
Then Apples, Bananas and Berries should be on the first page in that order.
Given I have 20 products
And my products include Apples, Bananas, and Berries
When I type 'ap' into the Filter by Name field
Then I should see "Apples"
And I should not see "Bananas"
etc .. and others.
, ActiveAdmin, , . , , (?).
TL; DR. : , , , ?