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
Feature: New users can register and confirm accounts | |
Scenario: A new user registers for our service | |
Given I am on the home page | |
When I select "Register" from the nav | |
And I submit my details | |
Then I should see the thank you page | |
And I should receive a confirmation email | |
Scenario: The new user correctly pastes their confirmation code |
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
isMultipleOf = (n)-> | |
(order)-> | |
order.get('quantity') % n == 0 | |
max = (accumulator, item)-> | |
accumulator = item if item > accumulator | |
accumulator | |
isGtZero = (quantity)-> | |
quantity > 0 |
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 send_status_email | |
# Sometimes a whole bunch of emails will be queued in quick-succession. | |
# This is to stop them all being sent to the customer. It deletes any | |
# jobs queued to send this email, and then queues another to happen in | |
# 1 minute. | |
applicable_job = proc do |job| | |
job.klass == 'CartNotifierWorker' && job.args == ['cart_status_changed', self.id] | |
end | |
Sidekiq::ScheduledSet.new.select(&applicable_job).map(&:delete) | |
CartNotifierWorker.perform_in(60.seconds, :cart_status_changed, self.id) if user? |
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
{ | |
"top_image":{}, | |
"bottom_image":{}, | |
"name":"2 Layer", | |
"state":"APPROVED", | |
"price":"62.0", | |
"width_in_mils":0, | |
"height_in_mils":0, | |
"pcb_layers":2, | |
"created_at":"2013-07-30T22:15:21Z", |
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
` ..,,:..,` | |
,'+++++++'';':::,,:. | |
`'+######'##+'';;';;;::,:, | |
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
1) UserNotificationHelper should eq "foo" | |
Failure/Error: it { expect(method(:user)).to eq "foo"} | |
expected: "foo" | |
got: #<Method: RSpec::Core::ExampleGroup::Nested_1(UserNotificationHelper)#user> | |
(compared using ==) | |
Diff: | |
@@ -1,2 +1,2 @@ |
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
App.Adapter = Ep.RestAdapter.extend | |
namespaceBinding: 'App.apiNamespace' | |
init: -> | |
@_super() | |
$.ajaxPrefilter (newOpts, oldOpts, xhr)-> | |
xhr.setRequestHeader('Authorization', App.get('sessionToken.token')) | |
_typeToString: (type)-> | |
if (typeof(type) == 'string') | |
chunks = type.split('.') |
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
registerNewUser: -> | |
@session.flush().then(((models)=> | |
newUser = @get('content') | |
@transitionToRoute('user', newUser) | |
), ((response)-> | |
console.log response | |
)) |
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
%% name = Rubby::Parser | |
%% { | |
def ast | |
@ast || @result | |
end | |
} | |
%% ast-location = Rubby::Nodes | |
%% comment = ast Comment(value) |
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
module ExpectsMethod | |
def expects(*what, &block) | |
its(*what, &block) | |
end | |
end | |
RSpec.configure do |c| | |
c.extend ExpectsMethod | |
c.alias_example_to :expected | |
end |