Created
June 10, 2010 18:46
-
-
Save abachman/433446 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The Tabular plugin: http://github.com/godlygeek/tabular | |
" nice indentation for Cucumber scripts (if you're not already nesting) | |
:'<,'>Tabularize /^.*\(Given\|And\|When\|Then\) /l0 | |
So that: | |
Scenario: Admin user should be able to access categories index from form library page | |
Given I am an admin user with the login "administrator" and the password "administrator" | |
And there is a active study | |
And a category exists with name: "Behavioral", category_type: "_treatment" | |
And I login as "administrator" authenticating with "administrator" | |
When I follow "Categories" within "#treatment_lists_categories_link" | |
Then I should be on the admin categories page | |
And I should see "Categories" within "#content_panel" | |
And I should see "Behavioral" within "#content_panel" | |
Can become: | |
Scenario: Admin user should be able to access categories index from form library page | |
Given I am an admin user with the login "administrator" and the password "administrator" | |
And there is a active study | |
And a category exists with name: "Behavioral", category_type: "_treatment" | |
And I login as "administrator" authenticating with "administrator" | |
When I follow "Categories" within "#treatment_lists_categories_link" | |
Then I should be on the admin categories page | |
And I should see "Categories" within "#content_panel" | |
And I should see "Behavioral" within "#content_panel" | |
When you've selected the second through last line. | |
To add a shortcut ("tabular pattern"), put: | |
AddTabularPattern! cucumber /^.*\(Given\|And\|When\|Then\) /l0 | |
in ~/.vim/after/plugin/TabularMaps.vim. Now you can use ":'<,'>Tabularize cucumber" instead of the whole pattern. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment