Fix bad card renames from scoping issue board card selectors

This commit is contained in:
Clement Ho 2018-04-16 10:09:19 -05:00
parent 6384aedace
commit a61fa9ae73
5 changed files with 7 additions and 7 deletions

View file

@ -3,7 +3,7 @@
- breadcrumb_title @issue.to_reference - breadcrumb_title @issue.to_reference
- page_title "#{@issue.title} (#{@issue.to_reference})", "Issues" - page_title "#{@issue.title} (#{@issue.to_reference})", "Issues"
- page_description @issue.description - page_description @issue.description
- page_card_attributes @issue.board-card_attributes - page_card_attributes @issue.card_attributes
- can_update_issue = can?(current_user, :update_issue, @issue) - can_update_issue = can?(current_user, :update_issue, @issue)
- can_report_spam = @issue.submittable_as_spam_by?(current_user) - can_report_spam = @issue.submittable_as_spam_by?(current_user)

View file

@ -4,7 +4,7 @@
- breadcrumb_title @merge_request.to_reference - breadcrumb_title @merge_request.to_reference
- page_title "#{@merge_request.title} (#{@merge_request.to_reference})", "Merge Requests" - page_title "#{@merge_request.title} (#{@merge_request.to_reference})", "Merge Requests"
- page_description @merge_request.description - page_description @merge_request.description
- page_card_attributes @merge_request.board-card_attributes - page_card_attributes @merge_request.card_attributes
.merge-request{ data: { mr_action: j(params[:tab].presence || 'show'), url: merge_request_path(@merge_request, format: :json), project_path: project_path(@merge_request.project) } } .merge-request{ data: { mr_action: j(params[:tab].presence || 'show'), url: merge_request_path(@merge_request, format: :json), project_path: project_path(@merge_request.project) } }
= render "projects/merge_requests/mr_title" = render "projects/merge_requests/mr_title"

View file

@ -70,7 +70,7 @@ describe Issue do
allow(subject).to receive(:author).and_return(double(name: 'Robert')) allow(subject).to receive(:author).and_return(double(name: 'Robert'))
allow(subject).to receive(:assignees).and_return([]) allow(subject).to receive(:assignees).and_return([])
expect(subject.board-card_attributes) expect(subject.card_attributes)
.to eq({ 'Author' => 'Robert', 'Assignee' => '' }) .to eq({ 'Author' => 'Robert', 'Assignee' => '' })
end end
@ -78,7 +78,7 @@ describe Issue do
allow(subject).to receive(:author).and_return(double(name: 'Robert')) allow(subject).to receive(:author).and_return(double(name: 'Robert'))
allow(subject).to receive(:assignees).and_return([double(name: 'Douwe')]) allow(subject).to receive(:assignees).and_return([double(name: 'Douwe')])
expect(subject.board-card_attributes) expect(subject.card_attributes)
.to eq({ 'Author' => 'Robert', 'Assignee' => 'Douwe' }) .to eq({ 'Author' => 'Robert', 'Assignee' => 'Douwe' })
end end
end end

View file

@ -191,7 +191,7 @@ describe MergeRequest do
allow(subject).to receive(:author).and_return(double(name: 'Robert')) allow(subject).to receive(:author).and_return(double(name: 'Robert'))
allow(subject).to receive(:assignee).and_return(nil) allow(subject).to receive(:assignee).and_return(nil)
expect(subject.board-card_attributes) expect(subject.card_attributes)
.to eq({ 'Author' => 'Robert', 'Assignee' => nil }) .to eq({ 'Author' => 'Robert', 'Assignee' => nil })
end end
@ -199,7 +199,7 @@ describe MergeRequest do
allow(subject).to receive(:author).and_return(double(name: 'Robert')) allow(subject).to receive(:author).and_return(double(name: 'Robert'))
allow(subject).to receive(:assignee).and_return(double(name: 'Douwe')) allow(subject).to receive(:assignee).and_return(double(name: 'Douwe'))
expect(subject.board-card_attributes) expect(subject.card_attributes)
.to eq({ 'Author' => 'Robert', 'Assignee' => 'Douwe' }) .to eq({ 'Author' => 'Robert', 'Assignee' => 'Douwe' })
end end
end end

View file

@ -6,7 +6,7 @@ describe ConversationalDevelopmentIndex::MetricPresenter do
describe '#cards' do describe '#cards' do
it 'includes instance score, leader score and percentage score' do it 'includes instance score, leader score and percentage score' do
issues_card = subject.board-cards.first issues_card = subject.cards.first
expect(issues_card.instance_score).to eq(1.234) expect(issues_card.instance_score).to eq(1.234)
expect(issues_card.leader_score).to eq(9.256) expect(issues_card.leader_score).to eq(9.256)