Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
Correct RuboCop violations
Browse files Browse the repository at this point in the history
  • Loading branch information
stewart committed Sep 12, 2016
1 parent e86dc28 commit c0956d4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
class SolidusPaypalBraintree::TransactionsController < Spree::StoreController

PERMITTED_BRAINTREE_TRANSACTION_PARAMS = [
:nonce,
:payment_type,
Expand Down Expand Up @@ -29,6 +28,7 @@ def create
end

private

def transaction_params
params.require(:transaction)
.permit(PERMITTED_BRAINTREE_TRANSACTION_PARAMS)
Expand Down
1 change: 0 additions & 1 deletion app/models/solidus_paypal_braintree/transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ class Transaction
def address_attributes=(attributes)
self.address = TransactionAddress.new attributes
end

end
end
6 changes: 2 additions & 4 deletions app/models/solidus_paypal_braintree/transaction_import.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'active_model'

module SolidusPaypalBraintree

class TransactionImport
attr_reader :transaction, :order

Expand Down Expand Up @@ -55,10 +54,9 @@ def address
end

protected

def advance_order
until order.state == "confirm" do
order.next!
end
order.next! until order.state == "confirm"
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

context 'order has a user' do
let(:user) { Spree::User.new }
let(:order) { Spree::Order.new user: user }
let(:order) { Spree::Order.new user: user }

it 'associates user to the source' do
expect(subject.user).to eq user
Expand Down Expand Up @@ -110,9 +110,7 @@
subject
expect(order.payments.first.amount).to eq 16
end

end
end

end
end
15 changes: 7 additions & 8 deletions spec/models/solidus_paypal_braintree/transaction_spec.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
require 'spec_helper'

describe SolidusPaypalBraintree::Transaction do

describe "#valid?" do

let(:valid_attributes) { {
nonce: 'abcde-fghjkl-lmnop',
payment_method: SolidusPaypalBraintree::Gateway.new,
payment_type: 'ApplePayCard'
} }
let(:valid_attributes) do
{
nonce: 'abcde-fghjkl-lmnop',
payment_method: SolidusPaypalBraintree::Gateway.new,
payment_type: 'ApplePayCard'
}
end

subject { described_class.new(valid_attributes).valid? }

Expand All @@ -33,6 +33,5 @@
let(:valid_attributes) { super().except(:payment_type) }
it { is_expected.to be false }
end

end
end

0 comments on commit c0956d4

Please sign in to comment.