background preloader

Better Specs

Better Specs
RSpec is a great tool in the behavior-driven development (BDD) process of writing human readable specifications that direct and validate the development of your application. On the web there are many resources that give complete overview of _what_ you can do with RSpec. But there are fewer resources devoted to how to create a great RSpec test suite. Better Specs tries to fill this gap by collecting most of the "best practices" that other developers learn through years of experience. Be clear about what method you are describing. For instance, use the Ruby documentation convention of .

http://betterspecs.org/

Building Web Apps with Active Admin We’ve been building a few web apps using Active Admin with great success. While Active Admin was primarily designed to create application back-ends, it is a great framework for building the customer facing part of Web Applications. Customize Active Admin with Factories & Components Active Admin layout can be customized using Factories. 6: Top 5 Cucumber best practices This is the sixth episode of our Testing Tuesday series. Every week we will share our insights and opinions on the software testing space. Drop by every Tuesday to learn more! Last week we talked about testing web applications with Selenium. How to use Cucumber – best practices The RSpec Book About this Book 450 pages Published: Release: P2.1 (2012-09-13) ISBN: 978-1-93435-637-1 You’ll get started right away with RSpec 2 and Cucumber by developing a simple game, using Cucumber to express high-level requirements in language your customer understands, and RSpec to express more granular requirements that focus on the behavior of individual objects in the system. You’ll learn how to use test doubles (mocks and stubs) to control the environment and focus the RSpec examples on one object at a time, and how to customize RSpec to “speak” in the language of your domain. You’ll develop Rails 3 applications and use companion tools such as Webrat and Selenium to express requirements for web applications both in memory and in the browser.

Start Testing Your Migrations. (Right Now) Migrations are a necessary part of any Rails project. At some point, you need to modify the structure of your database, normalize data that exists within those tables, or refactor the architecture entirely. The migrations for these tasks can vary in complexity from simple “add_column” statements to extreme SQL with nested joins and subselects. To be blunt, you can fark your data pretty easily by fat-fingering a migration. So how do we avoid this? In our daily routine as Agile developers, we follow a simple workflow to avoid these situations.

Rails API Testing Best Practices With RSpecMatthew Lehner Writing an API is almost a given with modern web applications. I’d like to lay out some simple guidelines and best practises for Rails API testing. We need to determine what to test and why it should be tested. Once we’ve established what we will be writing tests for, we will set up RSpec to do this quickly and easily. Basically we’ll be sending HTTP requests and testing that the response status codes and content match our expectations. What to test?

The Cucumber Book About this Book 336 pages Published: Release: P3.0 (2014-03-28) ISBN: 978-1-93435-680-7 Matt Wynne and Aslak Hellesøy show you how to express your customers’ wild ideas as a set of clear, executable specifications that everyone on the team can read. You’ll learn how to feed those examples into Cucumber and let it guide your development. You’ll build just the right code to keep your customers happy, and not a line more. Although it was born in the Ruby community, you can use Cucumber to test almost any system, from a simple shell script or Perl script, to web applications written in PHP, Java, or any platform.

CSS animations and transitions performance: looking inside the browser You’ve probably used CSS Animations or CSS Transitions in a project. (If not, check out CSS-Trick’s almanac entries on animations and transitions.) Some of your animations might have performed smoothly. Other might have appeared choppy. TDD JavaScript with Require.js and Teabag on Rails - Inline Block's Blog Introduction Test Driven Development, or TDD, is the process of writing tests before writing your code. Or minimally, testing the code that you write. Since starting to use require.js, I found it annoying that there were not many test runners in rails that would support require. I did find that Teabag had partial require support by defering the execution of tests until certain assets are loaded.

Scripted GUI Testing with Ruby If you need to automatically test a user interface, this book is for you. Whether it’s Windows, a Java platform (including Mac, Linux, and others) or a web app, you’ll see how to test it reliably and repeatably. Many automated test frameworks promise the world and deliver nothing but headaches. Port Scanning Techniques -sS (TCP SYN scan) SYN scan is the default and most popular scan option for good reasons. It can be performed quickly, scanning thousands of ports per second on a fast network not hampered by restrictive firewalls. It is also relatively unobtrusive and stealthy since it never completes TCP connections.

Monitor your systems using Monit on shared hosts non-root - Example with Rails3/Capistrano - Muriel's Tech Blog Do you know Monit? You definitely should. This is a high-quality and mature Open Source project, very well documented, that can monitor all your system resources (global and process-based). It is lightweight, efficient, can take corrective actions (restart servers…), provides real-time web interface, sends alerts, and is so easy to install and to use. Now that pitching is done, I will show you how to install it and configure it to monitor a Rails application running on Unicorn, deployed using Capistrano and on shared web host having no root privileges. WebDriverJs - selenium - A guide to using the JavaScript bindings for WebDriver. - Browser automation framework Getting Started (requires Node v0.8+) To get started with WebDriverJS for Node, you will need to download a copy of the ChromeDriver and ensure it can be found on your system PATH. All other browsers can be tested using the stand-alone Selenium server. Once you've obtained the ChromeDriver and placed it on your PATH, you can run your first test: var webdriver = require('selenium-webdriver');

Related: