Skip to content

Commit

Permalink
The installed beta versions should not be filtered
Browse files Browse the repository at this point in the history
The filter beta out should apply only to unregistered add-ons.
  • Loading branch information
Gilson Souza committed Mar 15, 2017
1 parent b5be495 commit af5ed73
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/lib/registration/ui/addon_selection_base_dialog.rb
Expand Up @@ -71,7 +71,12 @@ def addon_widget_id(addon)
# @param [Boolean] enable true for filtering beta releases
def filter_beta_releases(enable)
self.class.filter_beta = enable
@addons = enable ? @all_addons.reject(&:beta_release?) : @all_addons
if enable
@addons, available_addons = @all_addons.partition(&:registered?)
@addons.concat(available_addons.reject(&:beta_release?))
else
@addons = @all_addons
end
end

private
Expand Down
3 changes: 2 additions & 1 deletion test/addon_selection_dialog_test.rb
Expand Up @@ -20,7 +20,8 @@
describe "#initialize" do
it "sets the beta filter to the previous state" do
fake_ref = double.as_null_object
res = described_class.new(fake_ref)
registration = double(activated_products: [], get_addon_list: [])
res = described_class.new(registration)
res.send(:filter_beta_releases, false)

expect_any_instance_of(described_class).to receive(:filter_beta_releases).with(false)
Expand Down

0 comments on commit af5ed73

Please sign in to comment.