This repository has been archived by the owner on Jun 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add beta setting for Employee authentication (#1003)
* Add beta feature flag for Employee authentication
- Loading branch information
Showing
5 changed files
with
56 additions
and
11 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,13 @@ module ShopifyCli | |
class ShopifolkTest < MiniTest::Test | ||
include TestHelpers::FakeFS | ||
|
||
def test_correct_features_is_shopifolk | ||
def setup | ||
super | ||
ShopifyCli::Feature.enable('shopifolk-beta') | ||
ShopifyCli::Feature.disable('shopifolk') | ||
end | ||
|
||
def test_correct_features_is_shopifolk | ||
FileUtils.mkdir_p("/opt/dev/bin") | ||
FileUtils.touch("/opt/dev/bin/dev") | ||
FileUtils.touch("/opt/dev/.shopify-build") | ||
|
@@ -24,17 +29,14 @@ def test_feature_always_returns_true | |
end | ||
|
||
def test_no_gcloud_config_disables_shopifolk_feature | ||
ShopifyCli::Feature.enable('shopifolk') | ||
ShopifyCli::Feature.stubs(:enabled?).with('shopifolk').returns(false) | ||
refute ShopifyCli::Config.get_bool('features', 'shopifolk') | ||
|
||
ShopifyCli::Shopifolk.check | ||
|
||
refute ShopifyCli::Config.get_bool('features', 'shopifolk') | ||
end | ||
|
||
def test_no_section_in_gcloud_config_disables_shopifolk_feature | ||
ShopifyCli::Feature.enable('shopifolk') | ||
ShopifyCli::Feature.stubs(:enabled?).with('shopifolk').returns(false) | ||
stub_gcloud_ini({ "account" => "[email protected]", "project" => "shopify-dev" }) | ||
|
||
ShopifyCli::Shopifolk.check | ||
|
@@ -43,8 +45,6 @@ def test_no_section_in_gcloud_config_disables_shopifolk_feature | |
end | ||
|
||
def test_no_account_in_gcloud_config_disables_shopifolk_feature | ||
ShopifyCli::Feature.enable('shopifolk') | ||
ShopifyCli::Feature.stubs(:enabled?).with('shopifolk').returns(false) | ||
stub_gcloud_ini({ "[core]" => { "project" => "shopify-dev" } }) | ||
|
||
ShopifyCli::Shopifolk.check | ||
|
@@ -53,8 +53,6 @@ def test_no_account_in_gcloud_config_disables_shopifolk_feature | |
end | ||
|
||
def test_incorrect_email_in_gcloud_config_disables_shopifolk_feature | ||
ShopifyCli::Feature.enable('shopifolk') | ||
ShopifyCli::Feature.stubs(:enabled?).with('shopifolk').returns(false) | ||
stub_gcloud_ini({ "[core]" => { "account" => "[email protected]", "project" => "shopify-dev" } }) | ||
|
||
ShopifyCli::Shopifolk.check | ||
|
@@ -63,8 +61,6 @@ def test_incorrect_email_in_gcloud_config_disables_shopifolk_feature | |
end | ||
|
||
def test_incorrect_dev_path_disables_dev_shopifolk_feature | ||
ShopifyCli::Feature.enable('shopifolk') | ||
ShopifyCli::Feature.stubs(:enabled?).with('shopifolk').returns(false) | ||
stub_gcloud_ini({ "[core]" => { "account" => "[email protected]", "project" => "shopify-dev" } }) | ||
|
||
ShopifyCli::Shopifolk.check | ||
|