Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A Ruby library for testing SMS Text Messages using RSpec and Cucumber.
Ruby
tree: 598d3a77be

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
rails_generators
spec
.gitignore
Gemfile
Guardfile
README.markdown
Rakefile
text_spec.gemspec

README.markdown

Text Spec

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

Currently this gem only supports testing SMS messageing using the twilio-ruby gem.

Setup

Add the text_spec gem to your Gemfile:

group :test do
  gem 'text_spec'
end

RSpec

In your spec_helper.rb file add the following:

require 'text_spec'

If you want to have the helpers available in all of your example groups, you can add the following to your spec_helper.rb:

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

Otherwise you will have to incliude the helpers and matchers in any example where you use them:

describe "MyController" do
  include TextSpec::Helpers
  include TextSpec::Matchers
end

Cucumber

Add the folloing to you env.rb file:

require 'text_spec'
require 'text_spec/cucumber'

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

rails generate text_spec:steps
Something went wrong with that request. Please try again.