diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-15 03:08:43 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-15 03:08:43 +0300 |
commit | 45ccc5610c9afec64de3c4894789896ee2d5c48d (patch) | |
tree | 544b5e40167eca28e075cec24d4736283620b88e /spec/models | |
parent | 6b4c082fc8f266aa796595103e6c5f6ddb199280 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/group_import_state_spec.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/spec/models/group_import_state_spec.rb b/spec/models/group_import_state_spec.rb index 70884bf420e..9d9cb1e8391 100644 --- a/spec/models/group_import_state_spec.rb +++ b/spec/models/group_import_state_spec.rb @@ -35,4 +35,38 @@ describe GroupImportState do expect(import_state).to be_valid end end + + describe '#in_progress?' do + context "when the import is 'created'" do + it "returns true" do + group_import_state = build(:group_import_state, :created) + + expect(group_import_state.in_progress?).to eq true + end + end + + context "when the import is 'started'" do + it "returns true" do + group_import_state = build(:group_import_state, :started) + + expect(group_import_state.in_progress?).to eq true + end + end + + context "when the import is 'finished'" do + it "returns false" do + group_import_state = build(:group_import_state, :finished) + + expect(group_import_state.in_progress?).to eq false + end + end + + context "when the import is 'failed'" do + it "returns false" do + group_import_state = build(:group_import_state, :failed) + + expect(group_import_state.in_progress?).to eq false + end + end + end end |