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/controllers/branches_controller_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/controllers/branches_controller_spec.rb')
-rw-r--r-- | spec/controllers/branches_controller_spec.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/controllers/branches_controller_spec.rb b/spec/controllers/branches_controller_spec.rb index 610d7a84e31..d31870058ca 100644 --- a/spec/controllers/branches_controller_spec.rb +++ b/spec/controllers/branches_controller_spec.rb @@ -9,8 +9,8 @@ describe Projects::BranchesController do project.team << [user, :master] - project.stub(:branches).and_return(['master', 'foo/bar/baz']) - project.stub(:tags).and_return(['v1.0.0', 'v2.0.0']) + allow(project).to receive(:branches).and_return(['master', 'foo/bar/baz']) + allow(project).to receive(:tags).and_return(['v1.0.0', 'v2.0.0']) controller.instance_variable_set(:@project, project) end @@ -27,25 +27,25 @@ describe Projects::BranchesController do context "valid branch name, valid source" do let(:branch) { "merge_branch" } let(:ref) { "master" } - it { should redirect_to("/#{project.path_with_namespace}/tree/merge_branch") } + it { is_expected.to redirect_to("/#{project.path_with_namespace}/tree/merge_branch") } end context "invalid branch name, valid ref" do let(:branch) { "<script>alert('merge');</script>" } let(:ref) { "master" } - it { should redirect_to("/#{project.path_with_namespace}/tree/alert('merge');") } + it { is_expected.to redirect_to("/#{project.path_with_namespace}/tree/alert('merge');") } end context "valid branch name, invalid ref" do let(:branch) { "merge_branch" } let(:ref) { "<script>alert('ref');</script>" } - it { should render_template("new") } + it { is_expected.to render_template("new") } end context "invalid branch name, invalid ref" do let(:branch) { "<script>alert('merge');</script>" } let(:ref) { "<script>alert('ref');</script>" } - it { should render_template("new") } + it { is_expected.to render_template("new") } end end end |