summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <zegerjan@gitlab.com>2016-05-11 22:43:58 +0200
committerZeger-Jan van de Weg <zegerjan@gitlab.com>2016-05-11 22:43:58 +0200
commit4558b5b9fe9f648903ad0dc01089e6118fe0af34 (patch)
tree36903f41d1f773de3c8fc69592b714b8d9390e0f /spec
parent2f0d89ecff652418a8323990248b681a91f8e05b (diff)
downloadgitlab-ce-4558b5b9fe9f648903ad0dc01089e6118fe0af34.tar.gz
Incorporate feedback
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/projects/issues_controller_spec.rb6
-rw-r--r--spec/features/issues/award_emoji_spec.rb2
-rw-r--r--spec/models/concerns/issuable_spec.rb35
-rw-r--r--spec/requests/api/issues_spec.rb1
-rw-r--r--spec/requests/api/merge_requests_spec.rb1
5 files changed, 5 insertions, 40 deletions
diff --git a/spec/controllers/projects/issues_controller_spec.rb b/spec/controllers/projects/issues_controller_spec.rb
index 30d296fdad0..706f538f262 100644
--- a/spec/controllers/projects/issues_controller_spec.rb
+++ b/spec/controllers/projects/issues_controller_spec.rb
@@ -257,9 +257,9 @@ describe Projects::IssuesController do
project.team << [user, :developer]
end
- it "yields status code 200" do
- post(:toggle_award_emoji, namespace_id: project.namespace.path,
- project_id: project.path, id: issue.iid, name: "thumbsup")
+ it "toggles the award emoji" do
+ expect { post(:toggle_award_emoji, namespace_id: project.namespace.path,
+ project_id: project.path, id: issue.iid, name: "thumbsup") }.to change { AwardEmoji.count }.by(1)
expect(response.status).to eq(200)
end
diff --git a/spec/features/issues/award_emoji_spec.rb b/spec/features/issues/award_emoji_spec.rb
index 41af789aae2..07a854ea014 100644
--- a/spec/features/issues/award_emoji_spec.rb
+++ b/spec/features/issues/award_emoji_spec.rb
@@ -28,7 +28,6 @@ describe 'Awards Emoji', feature: true do
end
context 'click the thumbsup emoji' do
-
it 'should increment the thumbsup emoji', js: true do
find('[data-emoji="thumbsup"]').click
sleep 2
@@ -41,7 +40,6 @@ describe 'Awards Emoji', feature: true do
end
context 'click the thumbsdown emoji' do
-
it 'should increment the thumbsdown emoji', js: true do
find('[data-emoji="thumbsdown"]').click
sleep 2
diff --git a/spec/models/concerns/issuable_spec.rb b/spec/models/concerns/issuable_spec.rb
index 568bf4c9324..ebc3968023d 100644
--- a/spec/models/concerns/issuable_spec.rb
+++ b/spec/models/concerns/issuable_spec.rb
@@ -203,11 +203,10 @@ describe Issue, "Issuable" do
end
end
- # TODO ZJ
describe "votes" do
before do
- create!(:award_emoji, :upvote, awardable: issue)
- create!(:award_emoji, :downvote, awardable: issue)
+ create(:award_emoji, :upvote, awardable: issue)
+ create(:award_emoji, :downvote, awardable: issue)
end
it "returns correct values" do
@@ -215,34 +214,4 @@ describe Issue, "Issuable" do
expect(issue.downvotes).to eq(1)
end
end
-
- describe ".with_label" do
- let(:project) { create(:project, :public) }
- let(:bug) { create(:label, project: project, title: 'bug') }
- let(:feature) { create(:label, project: project, title: 'feature') }
- let(:enhancement) { create(:label, project: project, title: 'enhancement') }
- let(:issue1) { create(:issue, title: "Bugfix1", project: project) }
- let(:issue2) { create(:issue, title: "Bugfix2", project: project) }
- let(:issue3) { create(:issue, title: "Feature1", project: project) }
-
- before(:each) do
- issue1.labels << bug
- issue1.labels << feature
- issue2.labels << bug
- issue2.labels << enhancement
- issue3.labels << feature
- end
-
- it 'finds the correct issue containing just enhancement label' do
- expect(Issue.with_label(enhancement.title)).to match_array([issue2])
- end
-
- it 'finds the correct issues containing the same label' do
- expect(Issue.with_label(bug.title)).to match_array([issue1, issue2])
- end
-
- it 'finds the correct issues containing only both labels' do
- expect(Issue.with_label([bug.title, enhancement.title])).to match_array([issue2])
- end
- end
end
diff --git a/spec/requests/api/issues_spec.rb b/spec/requests/api/issues_spec.rb
index 9dd43f4fab3..7bc7e319ff1 100644
--- a/spec/requests/api/issues_spec.rb
+++ b/spec/requests/api/issues_spec.rb
@@ -249,7 +249,6 @@ describe API::API, api: true do
expect(json_response['milestone']).to be_a Hash
expect(json_response['assignee']).to be_a Hash
expect(json_response['author']).to be_a Hash
- expect(json_response['user_notes_count']).to be(1)
end
it "should return a project issue by id" do
diff --git a/spec/requests/api/merge_requests_spec.rb b/spec/requests/api/merge_requests_spec.rb
index 4b0111df149..6392bdb1c91 100644
--- a/spec/requests/api/merge_requests_spec.rb
+++ b/spec/requests/api/merge_requests_spec.rb
@@ -138,7 +138,6 @@ describe API::API, api: true do
expect(json_response['work_in_progress']).to be_falsy
expect(json_response['merge_when_build_succeeds']).to be_falsy
expect(json_response['merge_status']).to eq('can_be_merged')
- expect(json_response['user_notes_count']).to be(2)
end
it "should return merge_request" do