Skip to content

Instantly share code, notes, and snippets.

@andyh
Forked from anonymous/open_uri.rb
Last active December 15, 2015 05:49
Show Gist options
  • Save andyh/5212331 to your computer and use it in GitHub Desktop.
Save andyh/5212331 to your computer and use it in GitHub Desktop.
require 'spec_helper'
require 'open-uri'
it 'sends get request to web.memc to invoke the php script create_user_with_hashed_password - then validates the password in rails' do
password = 'testphp'
open_uri_result = ''
expect do
open("http://web.memc/create_user_with_hashed_password.php?password=#{password}").each do |f|
open_uri_result << f
end
end.to change(User.count).by(1)
open_uri_result.should eql('okay')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment