Skip to content

Commit

Permalink
Removes old emails from beta testers segment
Browse files Browse the repository at this point in the history
  • Loading branch information
decabeza committed Sep 24, 2018
1 parent 0a9f20d commit 6671304
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 0 additions & 2 deletions lib/user_segments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ def self.not_supported_on_current_budget

def self.beta_testers
testers = %w(aranacm@madrid.es
bertocq@gmail.com
mariajecheca@gmail.com
alberto@decabeza.es
voodoorai2000@gmail.com)

Expand Down
7 changes: 3 additions & 4 deletions spec/lib/user_segments_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,22 +192,21 @@

describe "#beta_testers" do
let(:beta_testers) do
%w(aranacm@madrid.es bertocq@gmail.com mariajecheca@gmail.com
alberto@decabeza.es voodoorai2000@gmail.com)
%w(aranacm@madrid.es alberto@decabeza.es voodoorai2000@gmail.com)
end

before do
beta_testers.each { |beta_tester| create(:user, email: beta_tester) }
end

it "returns only users with specific emails" do
expect(described_class.beta_testers.count).to eq(5)
expect(described_class.beta_testers.count).to eq(3)
expect(described_class.beta_testers.pluck(:email)).to match_array(beta_testers)
end

it "returns users sorted by `created_at` attribute" do
users = described_class.beta_testers.pluck(:email)
testers = User.order('created_at ASC').pluck(:email).last(5)
testers = User.order('created_at ASC').pluck(:email).last(3)
expect(users).to eq(testers)
end
end
Expand Down

0 comments on commit 6671304

Please sign in to comment.