From 62d7990b9bb30cf33ed87017c5c633d1cccc75c2 Mon Sep 17 00:00:00 2001 From: Toon Claes Date: Thu, 28 Feb 2019 19:57:34 +0100 Subject: Ran standardrb --fix on the whole codebase Inspired by https://twitter.com/searls/status/1101137953743613952 I decided to try https://github.com/testdouble/standard on our codebase. It's opinionated, but at least it's a _standard_. --- spec/requests/api/markdown_spec.rb | 74 +++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'spec/requests/api/markdown_spec.rb') diff --git a/spec/requests/api/markdown_spec.rb b/spec/requests/api/markdown_spec.rb index 0cf5c5677b9..44b54366bfc 100644 --- a/spec/requests/api/markdown_spec.rb +++ b/spec/requests/api/markdown_spec.rb @@ -43,7 +43,7 @@ describe API::Markdown do end context "when project is not found" do - let(:params) { { text: "Hello world!", gfm: true, project: "Dummy project" } } + let(:params) { {text: "Hello world!", gfm: true, project: "Dummy project"} } it_behaves_like "404 Project Not Found" end @@ -56,13 +56,13 @@ describe API::Markdown do context "when not using gfm" do context "without project" do - let(:params) { { text: text } } + let(:params) { {text: text} } it_behaves_like "rendered markdown text without GFM" end context "with project" do - let(:params) { { text: text, project: project.full_path } } + let(:params) { {text: text, project: project.full_path} } context "when not authorized" do it_behaves_like "404 Project Not Found" @@ -78,23 +78,23 @@ describe API::Markdown do context "when using gfm" do context "without project" do - let(:params) { { text: text, gfm: true } } + let(:params) { {text: text, gfm: true} } it "renders markdown text" do expect(response).to have_http_status(201) expect(response.headers["Content-Type"]).to eq("application/json") expect(json_response).to be_a(Hash) expect(json_response["html"]).to include("Hello world!") - .and include('data-name="tada"') - .and include('data-name="100"') - .and include("#1") - .and exclude("") + .and include('data-name="tada"') + .and include('data-name="100"') + .and include("#1") + .and exclude("") end end context "with project" do - let(:params) { { text: text, gfm: true, project: project.full_path } } + let(:params) { {text: text, gfm: true, project: project.full_path} } let(:user) { project.owner } it "renders markdown text" do @@ -102,55 +102,55 @@ describe API::Markdown do expect(response.headers["Content-Type"]).to eq("application/json") expect(json_response).to be_a(Hash) expect(json_response["html"]).to include("Hello world!") - .and include('data-name="tada"') - .and include('data-name="100"') - .and include("") + .and include('data-name="tada"') + .and include('data-name="100"') + .and include("") end end - context 'with a public project and confidential issue' do + context "with a public project and confidential issue" do let(:public_project) { create(:project, :public) } - let(:confidential_issue) { create(:issue, :confidential, project: public_project, title: 'Confidential title') } + let(:confidential_issue) { create(:issue, :confidential, project: public_project, title: "Confidential title") } let(:text) { ":tada: Hello world! :100: #{confidential_issue.to_reference}" } - let(:params) { { text: text, gfm: true, project: public_project.full_path } } + let(:params) { {text: text, gfm: true, project: public_project.full_path} } - shared_examples 'user without proper access' do - it 'does not render the title or link' do + shared_examples "user without proper access" do + it "does not render the title or link" do expect(response).to have_http_status(201) - expect(json_response["html"]).not_to include('Confidential title') - expect(json_response["html"]).not_to include('') + expect(json_response["html"]).not_to include("Confidential title") + expect(json_response["html"]).not_to include("") end end - context 'when not logged in' do + context "when not logged in" do let(:user) { } - it_behaves_like 'user without proper access' + it_behaves_like "user without proper access" end - context 'when logged in as user without access' do + context "when logged in as user without access" do let(:user) { create(:user) } - it_behaves_like 'user without proper access' + it_behaves_like "user without proper access" end - context 'when logged in as author' do + context "when logged in as author" do let(:user) { confidential_issue.author } - it 'renders the title or link' do + it "renders the title or link" do expect(response).to have_http_status(201) - expect(json_response["html"]).to include('Confidential title') - expect(json_response["html"]).to include('Hello world!') - .and include('data-name="tada"') - .and include('data-name="100"') - .and include("") + expect(json_response["html"]).to include("Confidential title") + expect(json_response["html"]).to include("Hello world!") + .and include('data-name="tada"') + .and include('data-name="100"') + .and include("") end end end -- cgit v1.2.1