summaryrefslogtreecommitdiff
path: root/spec/controllers/branches_controller_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers/branches_controller_spec.rb')
-rw-r--r--spec/controllers/branches_controller_spec.rb12
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