This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'integration/spec_helper' | |
feature 'New user sign up', :js => true do | |
pages :home_page, :registration_page, :registration_complete_page | |
let(:user_email) { 'matt@econsultancy.com' } | |
scenario %{ | |
User arrives on the home page, follows the sign up promotion, | |
fills in the form incorrectly, then corrects their mistakes, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# insert within your Application | |
config.middleware.insert_before(0, Rack::CloudFlareFixup) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def assigns_local(key) | |
controller.instance_variable_get('@patched_locals')[key] | |
end | |
def patch_controller_render_to_support_locals(controller) | |
def controller.render(options = nil, extra_options = {}, &block) | |
[options, extra_options].select { |o| o.kind_of?(Hash) }.each do |option_hash| | |
if option_hash.include?(:locals) | |
@patched_locals = option_hash[:locals] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe 'JSON view test' do | |
let(:partial) { 'admin/case_studies/_item.json' } | |
let(:case_study) { build_stubbed(:case_study) } | |
it 'should render item partial' do | |
JSON.parse(render_item_partial).should == { | |
id: case_study.id, | |
title: case_study.title, | |
whatever: case_study.title | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AccountService.sign_up | |
AccountService.sign_up_for_existing_membership | |
AccountService.leave_membership | |
AccountService.move_to_new_membership | |
sign_up = AccountService.sign_up | |
if sign_up.success | |
... | |
else | |
errors = sign_up.errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
results = File.expand_path('../tmp/failing_specs.log', __FILE__) | |
if File.exists?(test_file) | |
tests = File.open(test_file).read.scan(/rspec .\/([^:]+:\d+)/) | |
if tests.present? | |
Dir.chdir(Rails.root) do | |
command = "bundle exec rspec #{tests.join(' ')}" | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div>Ably Quickstart example</div> | |
<ul id="output"> | |
</ul> | |
Message: <input id="message" type="text" value="Hello"><br> | |
<input type="submit" id="publish" value="Publish the message"> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
font-family: Helvetica, Verdana | |
} | |
p { | |
padding: 7px 10px; | |
} | |
#demo { | |
border: 1px solid #999; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div>Ably Quickstart example</div> | |
<ul id="output"> | |
</ul> | |
Message: <input id="message" type="text" value="Hello"><br> | |
<input type="submit" id="publish" value="Publish the message"> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ASdsad |