diff options
author | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2015-02-12 19:17:35 +0100 |
---|---|---|
committer | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2015-02-12 19:17:35 +0100 |
commit | 0c4a70a306b871899bf87ce4673918abfee4d95f (patch) | |
tree | c7a702fb511209ffe0eceba245d1ffea71dce1aa /spec/lib/gitlab/git_access_spec.rb | |
parent | de1c450abd6b367390a1295cac402344f500d41d (diff) | |
download | gitlab-ce-0c4a70a306b871899bf87ce4673918abfee4d95f.tar.gz |
Updated rspec to rspec 3.x syntax
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
Diffstat (limited to 'spec/lib/gitlab/git_access_spec.rb')
-rw-r--r-- | spec/lib/gitlab/git_access_spec.rb | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/spec/lib/gitlab/git_access_spec.rb b/spec/lib/gitlab/git_access_spec.rb index fbcaa405f8d..666398eedd4 100644 --- a/spec/lib/gitlab/git_access_spec.rb +++ b/spec/lib/gitlab/git_access_spec.rb @@ -9,17 +9,17 @@ describe Gitlab::GitAccess do describe 'push to none protected branch' do it "returns true if user is a master" do project.team << [user, :master] - Gitlab::GitAccess.can_push_to_branch?(user, project, "random_branch").should be_true + expect(Gitlab::GitAccess.can_push_to_branch?(user, project, "random_branch")).to be_truthy end it "returns true if user is a developer" do project.team << [user, :developer] - Gitlab::GitAccess.can_push_to_branch?(user, project, "random_branch").should be_true + expect(Gitlab::GitAccess.can_push_to_branch?(user, project, "random_branch")).to be_truthy end it "returns false if user is a reporter" do project.team << [user, :reporter] - Gitlab::GitAccess.can_push_to_branch?(user, project, "random_branch").should be_false + expect(Gitlab::GitAccess.can_push_to_branch?(user, project, "random_branch")).to be_falsey end end @@ -30,17 +30,17 @@ describe Gitlab::GitAccess do it "returns true if user is a master" do project.team << [user, :master] - Gitlab::GitAccess.can_push_to_branch?(user, project, @branch.name).should be_true + expect(Gitlab::GitAccess.can_push_to_branch?(user, project, @branch.name)).to be_truthy end it "returns false if user is a developer" do project.team << [user, :developer] - Gitlab::GitAccess.can_push_to_branch?(user, project, @branch.name).should be_false + expect(Gitlab::GitAccess.can_push_to_branch?(user, project, @branch.name)).to be_falsey end it "returns false if user is a reporter" do project.team << [user, :reporter] - Gitlab::GitAccess.can_push_to_branch?(user, project, @branch.name).should be_false + expect(Gitlab::GitAccess.can_push_to_branch?(user, project, @branch.name)).to be_falsey end end @@ -51,17 +51,17 @@ describe Gitlab::GitAccess do it "returns true if user is a master" do project.team << [user, :master] - Gitlab::GitAccess.can_push_to_branch?(user, project, @branch.name).should be_true + expect(Gitlab::GitAccess.can_push_to_branch?(user, project, @branch.name)).to be_truthy end it "returns true if user is a developer" do project.team << [user, :developer] - Gitlab::GitAccess.can_push_to_branch?(user, project, @branch.name).should be_true + expect(Gitlab::GitAccess.can_push_to_branch?(user, project, @branch.name)).to be_truthy end it "returns false if user is a reporter" do project.team << [user, :reporter] - Gitlab::GitAccess.can_push_to_branch?(user, project, @branch.name).should be_false + expect(Gitlab::GitAccess.can_push_to_branch?(user, project, @branch.name)).to be_falsey end end @@ -74,7 +74,7 @@ describe Gitlab::GitAccess do context 'pull code' do subject { access.download_access_check(user, project) } - it { subject.allowed?.should be_true } + it { expect(subject.allowed?).to be_truthy } end end @@ -84,7 +84,7 @@ describe Gitlab::GitAccess do context 'pull code' do subject { access.download_access_check(user, project) } - it { subject.allowed?.should be_false } + it { expect(subject.allowed?).to be_falsey } end end @@ -97,7 +97,7 @@ describe Gitlab::GitAccess do context 'pull code' do subject { access.download_access_check(user, project) } - it { subject.allowed?.should be_false } + it { expect(subject.allowed?).to be_falsey } end end @@ -105,7 +105,7 @@ describe Gitlab::GitAccess do context 'pull code' do subject { access.download_access_check(user, project) } - it { subject.allowed?.should be_false } + it { expect(subject.allowed?).to be_falsey } end end @@ -117,13 +117,13 @@ describe Gitlab::GitAccess do before { key.projects << project } subject { access.download_access_check(key, project) } - it { subject.allowed?.should be_true } + it { expect(subject.allowed?).to be_truthy } end context 'denied' do subject { access.download_access_check(key, project) } - it { subject.allowed?.should be_false } + it { expect(subject.allowed?).to be_falsey } end end end @@ -207,7 +207,7 @@ describe Gitlab::GitAccess do context action do subject { access.push_access_check(user, project, changes[action]) } - it { subject.allowed?.should allowed ? be_true : be_false } + it { expect(subject.allowed?).to allowed ? be_truthy : be_falsey } end end end @@ -223,7 +223,7 @@ describe Gitlab::GitAccess do context action do subject { access.push_access_check(user, project, changes[action]) } - it { subject.allowed?.should allowed ? be_true : be_false } + it { expect(subject.allowed?).to allowed ? be_truthy : be_falsey } end end end |