diff options
author | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2015-02-12 19:53:23 +0100 |
---|---|---|
committer | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2015-02-12 21:00:55 +0100 |
commit | 026e988544f282c87afec9a85ff21a23877f6226 (patch) | |
tree | 91dde48a6b9afc7937b1c9b20815842be6c26408 /spec/features | |
parent | 5bb743efec0043d79ac508503c9e28bee5fae48f (diff) | |
download | gitlab-ce-026e988544f282c87afec9a85ff21a23877f6226.tar.gz |
Even more hound fixes
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/admin/admin_users_spec.rb | 22 | ||||
-rw-r--r-- | spec/features/atom/dashboard_issues_spec.rb | 13 | ||||
-rw-r--r-- | spec/features/atom/dashboard_spec.rb | 5 | ||||
-rw-r--r-- | spec/features/atom/issues_spec.rb | 33 | ||||
-rw-r--r-- | spec/features/atom/users_spec.rb | 18 | ||||
-rw-r--r-- | spec/features/issues_spec.rb | 93 | ||||
-rw-r--r-- | spec/features/notes_on_merge_requests_spec.rb | 131 | ||||
-rw-r--r-- | spec/features/profile_spec.rb | 16 |
8 files changed, 186 insertions, 145 deletions
diff --git a/spec/features/admin/admin_users_spec.rb b/spec/features/admin/admin_users_spec.rb index c6c9f1f33c1..f97b69713ce 100644 --- a/spec/features/admin/admin_users_spec.rb +++ b/spec/features/admin/admin_users_spec.rb @@ -33,15 +33,17 @@ describe "Admin::Users", feature: true do it "should apply defaults to user" do click_button "Create user" user = User.find_by(username: 'bang') - expect(user.projects_limit).to eq(Gitlab.config.gitlab.default_projects_limit) - expect(user.can_create_group).to eq(Gitlab.config.gitlab.default_can_create_group) + expect(user.projects_limit). + to eq(Gitlab.config.gitlab.default_projects_limit) + expect(user.can_create_group). + to eq(Gitlab.config.gitlab.default_can_create_group) end it "should create user with valid data" do click_button "Create user" user = User.find_by(username: 'bang') - expect(user.name).to eq("Big Bang") - expect(user.email).to eq("bigbang@mail.com") + expect(user.name).to eq('Big Bang') + expect(user.email).to eq('bigbang@mail.com') end it "should call send mail" do @@ -54,7 +56,7 @@ describe "Admin::Users", feature: true do click_button "Create user" user = User.find_by(username: 'bang') email = ActionMailer::Base.deliveries.last - expect(email.subject).to have_content("Account was created") + expect(email.subject).to have_content('Account was created') expect(email.text_part.body).to have_content(user.email) expect(email.text_part.body).to have_content('password') end @@ -80,8 +82,8 @@ describe "Admin::Users", feature: true do end it "should have user edit page" do - expect(page).to have_content("Name") - expect(page).to have_content("Password") + expect(page).to have_content('Name') + expect(page).to have_content('Password') end describe "Update user" do @@ -93,13 +95,13 @@ describe "Admin::Users", feature: true do end it "should show page with new data" do - expect(page).to have_content("bigbang@mail.com") - expect(page).to have_content("Big Bang") + expect(page).to have_content('bigbang@mail.com') + expect(page).to have_content('Big Bang') end it "should change user entry" do @simple_user.reload - expect(@simple_user.name).to eq("Big Bang") + expect(@simple_user.name).to eq('Big Bang') expect(@simple_user.is_admin?).to be_truthy end end diff --git a/spec/features/atom/dashboard_issues_spec.rb b/spec/features/atom/dashboard_issues_spec.rb index ceeb3e6c5aa..b710cb3c72f 100644 --- a/spec/features/atom/dashboard_issues_spec.rb +++ b/spec/features/atom/dashboard_issues_spec.rb @@ -17,12 +17,13 @@ describe "Dashboard Issues Feed", feature: true do it "should render atom feed via private token" do visit issues_dashboard_path(:atom, private_token: user.private_token) - expect(response_headers['Content-Type']).to have_content("application/atom+xml") - expect(body).to have_selector("title", text: "#{user.name} issues") - expect(body).to have_selector("author email", text: issue1.author_email) - expect(body).to have_selector("entry summary", text: issue1.title) - expect(body).to have_selector("author email", text: issue2.author_email) - expect(body).to have_selector("entry summary", text: issue2.title) + expect(response_headers['Content-Type']). + to have_content('application/atom+xml') + expect(body).to have_selector('title', text: "#{user.name} issues") + expect(body).to have_selector('author email', text: issue1.author_email) + expect(body).to have_selector('entry summary', text: issue1.title) + expect(body).to have_selector('author email', text: issue2.author_email) + expect(body).to have_selector('entry summary', text: issue2.title) end end end diff --git a/spec/features/atom/dashboard_spec.rb b/spec/features/atom/dashboard_spec.rb index 8e723b5c2ac..ad157d742ff 100644 --- a/spec/features/atom/dashboard_spec.rb +++ b/spec/features/atom/dashboard_spec.rb @@ -7,7 +7,7 @@ describe "Dashboard Feed", feature: true do context "projects atom feed via private token" do it "should render projects atom feed" do visit dashboard_path(:atom, private_token: user.private_token) - expect(body).to have_selector("feed title") + expect(body).to have_selector('feed title') end end @@ -28,7 +28,8 @@ describe "Dashboard Feed", feature: true do end it "should have issue comment event" do - expect(body).to have_content("#{user.name} commented on issue ##{issue.iid}") + expect(body). + to have_content("#{user.name} commented on issue ##{issue.iid}") end end end diff --git a/spec/features/atom/issues_spec.rb b/spec/features/atom/issues_spec.rb index 26422c8fdc0..43163e4113e 100644 --- a/spec/features/atom/issues_spec.rb +++ b/spec/features/atom/issues_spec.rb @@ -1,33 +1,36 @@ require 'spec_helper' -describe "Issues Feed", feature: true do - describe "GET /issues" do +describe 'Issues Feed', feature: true do + describe 'GET /issues' do let!(:user) { create(:user) } let!(:project) { create(:project) } let!(:issue) { create(:issue, author: user, project: project) } before { project.team << [user, :developer] } - context "when authenticated" do - it "should render atom feed" do + context 'when authenticated' do + it 'should render atom feed' do login_with user visit project_issues_path(project, :atom) - expect(response_headers['Content-Type']).to have_content("application/atom+xml") - expect(body).to have_selector("title", text: "#{project.name} issues") - expect(body).to have_selector("author email", text: issue.author_email) - expect(body).to have_selector("entry summary", text: issue.title) + expect(response_headers['Content-Type']). + to have_content('application/atom+xml') + expect(body).to have_selector('title', text: "#{project.name} issues") + expect(body).to have_selector('author email', text: issue.author_email) + expect(body).to have_selector('entry summary', text: issue.title) end end - context "when authenticated via private token" do - it "should render atom feed" do - visit project_issues_path(project, :atom, private_token: user.private_token) + context 'when authenticated via private token' do + it 'should render atom feed' do + visit project_issues_path(project, :atom, + private_token: user.private_token) - expect(response_headers['Content-Type']).to have_content("application/atom+xml") - expect(body).to have_selector("title", text: "#{project.name} issues") - expect(body).to have_selector("author email", text: issue.author_email) - expect(body).to have_selector("entry summary", text: issue.title) + expect(response_headers['Content-Type']). + to have_content('application/atom+xml') + expect(body).to have_selector('title', text: "#{project.name} issues") + expect(body).to have_selector('author email', text: issue.author_email) + expect(body).to have_selector('entry summary', text: issue.title) end end end diff --git a/spec/features/atom/users_spec.rb b/spec/features/atom/users_spec.rb index 37af48282db..c0316b073ad 100644 --- a/spec/features/atom/users_spec.rb +++ b/spec/features/atom/users_spec.rb @@ -4,17 +4,23 @@ describe "User Feed", feature: true do describe "GET /" do let!(:user) { create(:user) } - context "user atom feed via private token" do + context 'user atom feed via private token' do it "should render user atom feed" do visit user_path(user, :atom, private_token: user.private_token) - expect(body).to have_selector("feed title") + expect(body).to have_selector('feed title') end end context 'feed content' do let(:project) { create(:project) } - let(:issue) { create(:issue, project: project, author: user, description: '') } - let(:note) { create(:note, noteable: issue, author: user, note: 'Bug confirmed', project: project) } + let(:issue) do + create(:issue, project: project, + author: user, description: '') + end + let(:note) do + create(:note, noteable: issue, author: user, + note: 'Bug confirmed', project: project) + end before do project.team << [user, :master] @@ -23,11 +29,11 @@ describe "User Feed", feature: true do visit user_path(user, :atom, private_token: user.private_token) end - it "should have issue opened event" do + it 'should have issue opened event' do expect(body).to have_content("#{safe_name} opened issue ##{issue.iid}") end - it "should have issue comment event" do + it 'should have issue comment event' do expect(body). to have_content("#{safe_name} commented on issue ##{issue.iid}") end diff --git a/spec/features/issues_spec.rb b/spec/features/issues_spec.rb index 78e5adebc5c..f54155439cb 100644 --- a/spec/features/issues_spec.rb +++ b/spec/features/issues_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe "Issues", feature: true do +describe 'Issues', feature: true do include SortingHelper let(:project) { create(:project) } @@ -12,7 +12,7 @@ describe "Issues", feature: true do project.team << [[@user, user2], :developer] end - describe "Edit issue" do + describe 'Edit issue' do let!(:issue) do create(:issue, author: @user, @@ -25,30 +25,34 @@ describe "Issues", feature: true do click_link "Edit" end - it "should open new issue popup" do + it 'should open new issue popup' do expect(page).to have_content("Issue ##{issue.iid}") end - describe "fill in" do + describe 'fill in' do before do - fill_in "issue_title", with: "bug 345" - fill_in "issue_description", with: "bug description" + fill_in 'issue_title', with: 'bug 345' + fill_in 'issue_description', with: 'bug description' end - it { expect { click_button "Save changes" }.to_not change {Issue.count} } + it 'does not change issue count' do + expect { + click_button 'Save changes' + }.to_not change { Issue.count } + end - it "should update issue fields" do - click_button "Save changes" + it 'should update issue fields' do + click_button 'Save changes' expect(page).to have_content @user.name - expect(page).to have_content "bug 345" + expect(page).to have_content 'bug 345' expect(page).to have_content project.name end end end - describe "Editing issue assignee" do + describe 'Editing issue assignee' do let!(:issue) do create(:issue, author: @user, @@ -56,7 +60,7 @@ describe "Issues", feature: true do project: project) end - it 'allows user to select unasigned', :js => true do + it 'allows user to select unasigned', js: true do visit edit_project_issue_path(project, issue) expect(page).to have_content "Assign to #{@user.name}" @@ -65,14 +69,14 @@ describe "Issues", feature: true do sleep 2 # wait for ajax stuff to complete first('.user-result').click - click_button "Save changes" + click_button 'Save changes' expect(page).to have_content 'Assignee: none' expect(issue.reload.assignee).to be_nil end end - describe "Filter issue" do + describe 'Filter issue' do before do ['foobar', 'barbaz', 'gitlab'].each do |title| create(:issue, @@ -90,7 +94,7 @@ describe "Issues", feature: true do let(:issue) { @issue } - it "should allow filtering by issues with no specified milestone" do + it 'should allow filtering by issues with no specified milestone' do visit project_issues_path(project, milestone_id: '0') expect(page).not_to have_content 'foobar' @@ -98,7 +102,7 @@ describe "Issues", feature: true do expect(page).to have_content 'gitlab' end - it "should allow filtering by a specified milestone" do + it 'should allow filtering by a specified milestone' do visit project_issues_path(project, milestone_id: issue.milestone.id) expect(page).to have_content 'foobar' @@ -106,7 +110,7 @@ describe "Issues", feature: true do expect(page).not_to have_content 'gitlab' end - it "should allow filtering by issues with no specified assignee" do + it 'should allow filtering by issues with no specified assignee' do visit project_issues_path(project, assignee_id: '0') expect(page).to have_content 'foobar' @@ -114,7 +118,7 @@ describe "Issues", feature: true do expect(page).not_to have_content 'gitlab' end - it "should allow filtering by a specified assignee" do + it 'should allow filtering by a specified assignee' do visit project_issues_path(project, assignee_id: @user.id) expect(page).not_to have_content 'foobar' @@ -126,7 +130,11 @@ describe "Issues", feature: true do describe 'filter issue' do titles = ['foo','bar','baz'] titles.each_with_index do |title, index| - let!(title.to_sym) { create(:issue, title: title, project: project, created_at: Time.now - (index * 60)) } + let!(title.to_sym) do + create(:issue, title: title, + project: project, + created_at: Time.now - (index * 60)) + end end let(:newer_due_milestone) { create(:milestone, due_date: '2013-12-11') } let(:later_due_milestone) { create(:milestone, due_date: '2013-12-12') } @@ -134,15 +142,15 @@ describe "Issues", feature: true do it 'sorts by newest' do visit project_issues_path(project, sort: sort_value_recently_created) - expect(first_issue).to include("foo") - expect(last_issue).to include("baz") + expect(first_issue).to include('foo') + expect(last_issue).to include('baz') end it 'sorts by oldest' do visit project_issues_path(project, sort: sort_value_oldest_created) - expect(first_issue).to include("baz") - expect(last_issue).to include("foo") + expect(first_issue).to include('baz') + expect(last_issue).to include('foo') end it 'sorts by most recently updated' do @@ -150,7 +158,7 @@ describe "Issues", feature: true do baz.save visit project_issues_path(project, sort: sort_value_recently_updated) - expect(first_issue).to include("baz") + expect(first_issue).to include('baz') end it 'sorts by least recently updated' do @@ -158,7 +166,7 @@ describe "Issues", feature: true do baz.save visit project_issues_path(project, sort: sort_value_oldest_updated) - expect(first_issue).to include("baz") + expect(first_issue).to include('baz') end describe 'sorting by milestone' do @@ -172,13 +180,13 @@ describe "Issues", feature: true do it 'sorts by recently due milestone' do visit project_issues_path(project, sort: sort_value_milestone_soon) - expect(first_issue).to include("foo") + expect(first_issue).to include('foo') end it 'sorts by least recently due milestone' do visit project_issues_path(project, sort: sort_value_milestone_later) - expect(first_issue).to include("bar") + expect(first_issue).to include('bar') end end @@ -193,10 +201,12 @@ describe "Issues", feature: true do end it 'sorts with a filter applied' do - visit project_issues_path(project, sort: sort_value_oldest_created, assignee_id: user2.id) + visit project_issues_path(project, + sort: sort_value_oldest_created, + assignee_id: user2.id) - expect(first_issue).to include("bar") - expect(last_issue).to include("foo") + expect(first_issue).to include('bar') + expect(last_issue).to include('foo') expect(page).not_to have_content 'baz' end end @@ -210,11 +220,13 @@ describe "Issues", feature: true do it 'with dropdown menu' do visit project_issue_path(project, issue) - find('.edit-issue.inline-update #issue_assignee_id').set project.team.members.first.id + find('.edit-issue.inline-update #issue_assignee_id'). + set project.team.members.first.id click_button 'Update Issue' - expect(page).to have_content "Assignee:" - has_select?('issue_assignee_id', :selected => project.team.members.first.name) + expect(page).to have_content 'Assignee:' + has_select?('issue_assignee_id', + selected: project.team.members.first.name) end end @@ -228,7 +240,7 @@ describe "Issues", feature: true do issue.save end - it "shows assignee text", js: true do + it 'shows assignee text', js: true do logout login_with guest @@ -247,12 +259,13 @@ describe "Issues", feature: true do it 'with dropdown menu' do visit project_issue_path(project, issue) - find('.edit-issue.inline-update').select(milestone.title, from: 'issue_milestone_id') + find('.edit-issue.inline-update'). + select(milestone.title, from: 'issue_milestone_id') click_button 'Update Issue' expect(page).to have_content "Milestone changed to #{milestone.title}" expect(page).to have_content "Milestone: #{milestone.title}" - has_select?('issue_assignee_id', :selected => milestone.title) + has_select?('issue_assignee_id', selected: milestone.title) end end @@ -265,7 +278,7 @@ describe "Issues", feature: true do issue.save end - it "shows milestone text", js: true do + it 'shows milestone text', js: true do logout login_with guest @@ -282,7 +295,7 @@ describe "Issues", feature: true do issue.save end - it 'allows user to remove assignee', :js => true do + it 'allows user to remove assignee', js: true do visit project_issue_path(project, issue) expect(page).to have_content "Assignee: #{user2.name}" @@ -298,10 +311,10 @@ describe "Issues", feature: true do end def first_issue - all("ul.issues-list li").first.text + all('ul.issues-list li').first.text end def last_issue - all("ul.issues-list li").last.text + all('ul.issues-list li').last.text end end diff --git a/spec/features/notes_on_merge_requests_spec.rb b/spec/features/notes_on_merge_requests_spec.rb index 2884c560a7c..7790d0ecd73 100644 --- a/spec/features/notes_on_merge_requests_spec.rb +++ b/spec/features/notes_on_merge_requests_spec.rb @@ -3,10 +3,12 @@ require 'spec_helper' describe 'Comments' do include RepoHelpers - describe "On a merge request", js: true, feature: true do + describe 'On a merge request', js: true, feature: true do let!(:merge_request) { create(:merge_request) } let!(:project) { merge_request.source_project } - let!(:note) { create(:note_on_merge_request, :with_attachment, project: project) } + let!(:note) do + create(:note_on_merge_request, :with_attachment, project: project) + end before do login_as :admin @@ -15,19 +17,20 @@ describe 'Comments' do subject { page } - describe "the note form" do + describe 'the note form' do it 'should be valid' do - is_expected.to have_css(".js-main-target-form", visible: true, count: 1) - expect(find(".js-main-target-form input[type=submit]").value).to eq("Add Comment") + is_expected.to have_css('.js-main-target-form', visible: true, count: 1) + expect(find('.js-main-target-form input[type=submit]').value). + to eq('Add Comment') within('.js-main-target-form') do expect(page).not_to have_link('Cancel') end end - describe "with text" do + describe 'with text' do before do - within(".js-main-target-form") do - fill_in "note[note]", with: "This is awesome" + within('.js-main-target-form') do + fill_in 'note[note]', with: 'This is awesome' end end @@ -40,41 +43,45 @@ describe 'Comments' do end end - describe "when posting a note" do + describe 'when posting a note' do before do - within(".js-main-target-form") do - fill_in "note[note]", with: "This is awsome!" + within('.js-main-target-form') do + fill_in 'note[note]', with: 'This is awsome!' find('.js-md-preview-button').click - click_button "Add Comment" + click_button 'Add Comment' end end it 'should be added and form reset' do - is_expected.to have_content("This is awsome!") + is_expected.to have_content('This is awsome!') within('.js-main-target-form') do expect(page).to have_no_field('note[note]', with: 'This is awesome!') expect(page).to have_css('.js-md-preview', visible: :hidden) end - within(".js-main-target-form") { is_expected.to have_css(".js-note-text", visible: true) } + within('.js-main-target-form') do + is_expected.to have_css('.js-note-text', visible: true) + end end end - describe "when editing a note", js: true do - it "should contain the hidden edit form" do - within("#note_#{note.id}") { is_expected.to have_css(".note-edit-form", visible: false) } + describe 'when editing a note', js: true do + it 'should contain the hidden edit form' do + within("#note_#{note.id}") do + is_expected.to have_css('.note-edit-form', visible: false) + end end - describe "editing the note" do + describe 'editing the note' do before do find('.note').hover find(".js-note-edit").click end - it "should show the note edit form and hide the note body" do + it 'should show the note edit form and hide the note body' do within("#note_#{note.id}") do - expect(find(".current-note-edit-form", visible: true)).to be_visible - expect(find(".note-edit-form", visible: true)).to be_visible - expect(find(:css, ".note-text", visible: false)).not_to be_visible + expect(find('.current-note-edit-form', visible: true)).to be_visible + expect(find('.note-edit-form', visible: true)).to be_visible + expect(find(:css, '.note-text', visible: false)).not_to be_visible end end @@ -87,41 +94,43 @@ describe 'Comments' do #end #end - it "appends the edited at time to the note" do - within(".current-note-edit-form") do - fill_in "note[note]", with: "Some new content" - find(".btn-save").click + it 'appends the edited at time to the note' do + within('.current-note-edit-form') do + fill_in 'note[note]', with: 'Some new content' + find('.btn-save').click end within("#note_#{note.id}") do - is_expected.to have_css(".note_edited_ago") - expect(find(".note_edited_ago").text).to match(/less than a minute ago/) + is_expected.to have_css('.note_edited_ago') + expect(find('.note_edited_ago').text). + to match(/less than a minute ago/) end end end - describe "deleting an attachment" do + describe 'deleting an attachment' do before do find('.note').hover - find(".js-note-edit").click + find('.js-note-edit').click end - it "shows the delete link" do - within(".note-attachment") do - is_expected.to have_css(".js-note-attachment-delete") + it 'shows the delete link' do + within('.note-attachment') do + is_expected.to have_css('.js-note-attachment-delete') end end - it "removes the attachment div and resets the edit form" do - find(".js-note-attachment-delete").click - is_expected.not_to have_css(".note-attachment") - expect(find(".current-note-edit-form", visible: false)).not_to be_visible + it 'removes the attachment div and resets the edit form' do + find('.js-note-attachment-delete').click + is_expected.not_to have_css('.note-attachment') + expect(find('.current-note-edit-form', visible: false)). + not_to be_visible end end end end - describe "On a merge request diff", js: true, feature: true do + describe 'On a merge request diff', js: true, feature: true do let(:merge_request) { create(:merge_request) } let(:project) { merge_request.source_project } @@ -132,68 +141,74 @@ describe 'Comments' do subject { page } - describe "when adding a note" do + describe 'when adding a note' do before do click_diff_line end - describe "the notes holder" do - it { is_expected.to have_css(".js-temp-notes-holder") } + describe 'the notes holder' do + it { is_expected.to have_css('.js-temp-notes-holder') } - it { within(".js-temp-notes-holder") { is_expected.to have_css(".new_note") } } + it 'has .new_note css class' do + within('.js-temp-notes-holder') do + expect(subject).to have_css('.new_note') + end + end end - describe "the note form" do + describe 'the note form' do it "shouldn't add a second form for same row" do click_diff_line - is_expected.to have_css("tr[id='#{line_code}'] + .js-temp-notes-holder form", count: 1) + is_expected. + to have_css("tr[id='#{line_code}'] + .js-temp-notes-holder form", + count: 1) end - it "should be removed when canceled" do + it 'should be removed when canceled' do within(".diff-file form[rel$='#{line_code}']") do - find(".js-close-discussion-note-form").trigger("click") + find('.js-close-discussion-note-form').trigger('click') end - is_expected.to have_no_css(".js-temp-notes-holder") + is_expected.to have_no_css('.js-temp-notes-holder') end end end - describe "with muliple note forms" do + describe 'with muliple note forms' do before do click_diff_line click_diff_line(line_code_2) end - it { is_expected.to have_css(".js-temp-notes-holder", count: 2) } + it { is_expected.to have_css('.js-temp-notes-holder', count: 2) } - describe "previewing them separately" do + describe 'previewing them separately' do before do # add two separate texts and trigger previews on both within("tr[id='#{line_code}'] + .js-temp-notes-holder") do - fill_in "note[note]", with: "One comment on line 7" + fill_in 'note[note]', with: 'One comment on line 7' find('.js-md-preview-button').click end within("tr[id='#{line_code_2}'] + .js-temp-notes-holder") do - fill_in "note[note]", with: "Another comment on line 10" + fill_in 'note[note]', with: 'Another comment on line 10' find('.js-md-preview-button').click end end end - describe "posting a note" do + describe 'posting a note' do before do within("tr[id='#{line_code_2}'] + .js-temp-notes-holder") do - fill_in "note[note]", with: "Another comment on line 10" - click_button("Add Comment") + fill_in 'note[note]', with: 'Another comment on line 10' + click_button('Add Comment') end end it 'should be added as discussion' do - is_expected.to have_content("Another comment on line 10") - is_expected.to have_css(".notes_holder") - is_expected.to have_css(".notes_holder .note", count: 1) + is_expected.to have_content('Another comment on line 10') + is_expected.to have_css('.notes_holder') + is_expected.to have_css('.notes_holder .note', count: 1) is_expected.to have_button('Reply') end end diff --git a/spec/features/profile_spec.rb b/spec/features/profile_spec.rb index dfbe65cee9d..3d36a3c02d0 100644 --- a/spec/features/profile_spec.rb +++ b/spec/features/profile_spec.rb @@ -1,34 +1,34 @@ require 'spec_helper' -describe "Profile account page", feature: true do +describe 'Profile account page', feature: true do let(:user) { create(:user) } before do login_as :user end - describe "when signup is enabled" do + describe 'when signup is enabled' do before do ApplicationSetting.any_instance.stub(signup_enabled?: true) visit profile_account_path end - it { expect(page).to have_content("Remove account") } + it { expect(page).to have_content('Remove account') } - it "should delete the account" do - expect { click_link "Delete account" }.to change {User.count}.by(-1) + it 'should delete the account' do + expect { click_link 'Delete account' }.to change { User.count }.by(-1) expect(current_path).to eq(new_user_session_path) end end - describe "when signup is disabled" do + describe 'when signup is disabled' do before do ApplicationSetting.any_instance.stub(signup_enabled?: false) visit profile_account_path end - it "should not have option to remove account" do - expect(page).not_to have_content("Remove account") + it 'should not have option to remove account' do + expect(page).not_to have_content('Remove account') expect(current_path).to eq(profile_account_path) end end |