ngty

ngty

Login ngty

Website http://tyenglog.blogspot.com

-1 votes

4292 views

Write ur own spec macros

Macro-writing is a great way to keep ur specs beautiful, compact & readable, & keeps specs writing fun. Macro-writing isn't rocket science, everyone can do it (almost, i think).

Comments

by ngty
ngty

-4 votes

3171 views

Writing specs for 3rd party declaratives

Using declaratives (eg. acts_as_authentic) provided by external libs is unavoidable in building a rails application. But testing 3rd party libs is surely not part of our work, yet how do we rest assured that these declaratives are called ??

Comments

by ngty
ngty

5 votes

3316 views

Use nested step to improve readability of ur scenario

When a scenario has too many steps, it becomes hard to read & follow. Using nested step helps to clean up the scenario, & helps promote reusability of groups of steps, think of it as code refactoring.

Comments

by ngty
ngty

9 votes

2963 views

Use 'Background' to consolidate common steps in a feature

Very often, we tend to repeat a number of common steps in all scenarios within a feature, to dry things up, as well as improve readability (helping reader to better focus the intent of each scenario), we can use 'Background'.

Comments

by ngty
ngty

3 votes

3013 views

Use pickle & ur choice factory for data setup in ur cucumber features (revised)

Data setup is sometimes painful in features writing for cucumber. Use pickle & factory of ur choice to make it less painful.

Comments

by ngty
ngty

8 votes

22279 views

Use I18n.localize for date/time formating

For reliable formatting of a date/time string in the desired language, use I18n.localise, Time#strftime can cause u unnecessary headache.

Comments

by ngty
ngty