rosskevin/sms-spec

View on GitHub
lib/generators/sms_spec/steps/templates/sms_steps.rb

Summary

Maintainability
A
0 mins
Test Coverage
# -------------------------------------------
# Available methods
# -------------------------------------------

# messages
# add_message
# set_current_number
# current_number
# clear_messages
# current_text_message
# open_last_text_message_for


Given /^no text messages have been sent$/ do
  clear_messages
end

Given /^all text messages have been read$/ do
  clear_messages
end

Then /^"([^"]*)" should receive a text message$/ do |phone_number|
  expect(messages_for(phone_number)).to_not be_empty
end

Then /^"([^"]*)" should receive no text messages$/ do |phone_number|
  expect(messages_for(phone_number)).to be_empty
end

When /^"([^"]*?)" opens? the text message$/ do |mobile_number|
  open_last_text_message_for(mobile_number)
end

Then /^I should see "([^"]*)" in the text message body$/ do |content|
  expect(current_text_message).to have_body(content)
end

Then /^I should see the following in the text message body:$/ do |content|
  expect(current_text_message).to have_body(content)
end