SMS Spec

Build Status Code Climate

An RSpec DSL and Cucumber steps to test SMS interactions with your Ruby on Rails application.

Currently this gem only supports testing SMS messaging using the twilio-ruby and lookout-clickatell gem.

Setup

Add the sms-spec gem to Gemfile:

group :test do
  gem 'sms-spec'
end

RSpec

Configure a driver and include helper and matcher methods in the spec_helper.rb:

require 'sms_spec'

Spec::Runner.configure do |config|
  config.include(SmsSpec::Helpers)
  config.include(SmsSpec::Matchers)
end

SmsSpec.driver = :twilio-ruby #this can be any available sms-spec driver

Cucumber

Add the following to env.rb:

require 'sms_spec'
require 'sms_spec/cucumber'

This loads the sms_spec RSpec helpers into your cucumber wold. Then, run the following to generate the text_messsage_steps.rb file:

rails generate sms_spec:steps