Skip to content

Commit

Permalink
Fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
gylaz committed Jul 12, 2021
1 parent 9e2fed4 commit 253c41e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/models/plan_selector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class PlanSelector
BULK_ID = "bulk".freeze
MARKETPLACE_URL = ENV.fetch(
"MARKETPLACE_URL",
"https://www.github.com/marketplace/hound"
"https://www.github.com/marketplace/hound",
)

def initialize(owner)
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/plan.rake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace :plan do
task migrate_owners: :environment do
owners = Repo.joins(:subscription).map(&:owner).uniq
owners.each do |owner|
stripe_user = owner.repos.active.find(&:subscription).subscription.user
stripe_user = owner.repos.active.detect(&:subscription).subscription.user
puts "Onwer #{owner.name} mapped to user #{stripe_user.username}"

owner.update!(stripe_customer_id: stripe_user.stripe_customer_id)
Expand Down
2 changes: 1 addition & 1 deletion spec/features/account_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
private

def stub_customer_find_request_with_subscriptions(customer_id, subscriptions)
url = "#{StripeApiHelper::STRIPE_BASE_URL}/customers/#{customer_id}"
url = "#{StripeApiHelper::STRIPE_BASE_URL}/customers/#{customer_id}"
stub_request(:get, url).
with(headers: { "Authorization" => "Bearer #{ENV['STRIPE_API_KEY']}" }).
to_return(status: 200, body: merge_customer_subscriptions(subscriptions))
Expand Down
2 changes: 1 addition & 1 deletion spec/features/user_deactivates_a_repo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
scenario "successfully deactivates the repo" do
token = "letmein"
user = create(:user)
owner = create(:owner, name: user.username)
repo = create(:repo, :active, private: true)
create(:subscription, user: user, repo: repo)
create(:owner, name: user.username)
gateway_subscription = instance_double(
"PaymentGatewaySubscription",
unsubscribe: true,
Expand Down
6 changes: 3 additions & 3 deletions spec/presenters/plan_presenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
context "when the plan matches the user's current plan" do
it "returns true" do
user = create(:user)
owner = create(:owner, name: user.username)
create(:owner, name: user.username)
plan = StripePlan.new(**StripePlan::PLANS.first)
presenter = PlanPresenter.new(plan: plan, user: user)

Expand All @@ -26,7 +26,7 @@
context "when the plan does not match the user's current plan" do
it "returns false" do
user = create(:user)
owner = create(:owner, name: user.username)
create(:owner, name: user.username)
plan = StripePlan.new(**StripePlan::PLANS.second)
presenter = PlanPresenter.new(plan: plan, user: user)

Expand All @@ -39,7 +39,7 @@
context "when the plan matches the user's next plan" do
it "returns true" do
user = create(:user)
owner = create(:owner, name: user.username)
create(:owner, name: user.username)
plan = StripePlan.new(**StripePlan::PLANS.second)
presenter = PlanPresenter.new(plan: plan, user: user)

Expand Down
4 changes: 2 additions & 2 deletions spec/support/helpers/stripe_api_helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module StripeApiHelper
STRIPE_BASE_URL = "https://api.stripe.com/v1".freeze
STRIPE_CUSTOMER_ID = "cus_2e3fqARc1uHtCv"
STRIPE_SUBSCRIPTION_ID = "sub_488ZZngNkyRMiR"
STRIPE_CUSTOMER_ID = "cus_2e3fqARc1uHtCv".freeze
STRIPE_SUBSCRIPTION_ID = "sub_488ZZngNkyRMiR".freeze

def stub_customer_create_request(user)
stub_request(:post, "#{STRIPE_BASE_URL}/customers").with(
Expand Down

0 comments on commit 253c41e

Please sign in to comment.