Commit a409ed56386a29a5d09a86620ad06e0c2ffe82b8
1 parent
59fb0d69
Exists in
master
and in
1 other branch
add new tracker icons to problem/show page
Showing
15 changed files
with
162 additions
and
115 deletions
Show diff stats
app/assets/stylesheets/errbit.css.erb
@@ -604,6 +604,11 @@ div.notification_service.nested .label_radio input { | @@ -604,6 +604,11 @@ div.notification_service.nested .label_radio input { | ||
604 | position: absolute; left: -9999px; | 604 | position: absolute; left: -9999px; |
605 | } | 605 | } |
606 | 606 | ||
607 | +.button-icon { | ||
608 | + float: left; | ||
609 | + margin: 5px 0 0 6px; | ||
610 | +} | ||
611 | + | ||
607 | div.issue_tracker.nested label.r_on, div.issue_tracker.nested label.r_on:hover, div.notification_service.nested label.r_on, div.notification_service.nested label.r_on:hover { | 612 | div.issue_tracker.nested label.r_on, div.issue_tracker.nested label.r_on:hover, div.notification_service.nested label.r_on, div.notification_service.nested label.r_on:hover { |
608 | color: #191919; | 613 | color: #191919; |
609 | } | 614 | } |
app/controllers/apps_controller.rb
@@ -12,7 +12,7 @@ class AppsController < ApplicationController | @@ -12,7 +12,7 @@ class AppsController < ApplicationController | ||
12 | } | 12 | } |
13 | 13 | ||
14 | expose(:apps) { | 14 | expose(:apps) { |
15 | - app_scope.all.sort.to_a | 15 | + app_scope.all.sort.map { |app| AppDecorator.new(app) } |
16 | } | 16 | } |
17 | 17 | ||
18 | expose(:app, ancestor: :app_scope, attributes: :app_params) | 18 | expose(:app, ancestor: :app_scope, attributes: :app_params) |
app/controllers/problems_controller.rb
@@ -12,28 +12,23 @@ class ProblemsController < ApplicationController | @@ -12,28 +12,23 @@ class ProblemsController < ApplicationController | ||
12 | :resolve_several, :unresolve_several, :unmerge_several | 12 | :resolve_several, :unresolve_several, :unmerge_several |
13 | ] | 13 | ] |
14 | 14 | ||
15 | + expose(:app_scope) { | ||
16 | + apps = current_user.admin? ? App.all : current_user.apps | ||
17 | + params[:app_id] ? apps.where(:_id => params[:app_id]) : apps | ||
18 | + } | ||
19 | + | ||
15 | expose(:app) { | 20 | expose(:app) { |
16 | - if current_user.admin? | ||
17 | - App.find(params[:app_id]) | ||
18 | - else | ||
19 | - current_user.apps.find(params[:app_id]) | ||
20 | - end | 21 | + AppDecorator.new app_scope.find(params[:app_id]) |
21 | } | 22 | } |
22 | 23 | ||
23 | expose(:problem) { | 24 | expose(:problem) { |
24 | app.problems.find(params[:id]) | 25 | app.problems.find(params[:id]) |
25 | } | 26 | } |
26 | 27 | ||
27 | - | ||
28 | expose(:all_errs) { | 28 | expose(:all_errs) { |
29 | params[:all_errs] | 29 | params[:all_errs] |
30 | } | 30 | } |
31 | 31 | ||
32 | - expose(:app_scope) { | ||
33 | - apps = current_user.admin? ? App.all : current_user.apps | ||
34 | - params[:app_id] ? apps.where(:_id => params[:app_id]) : apps | ||
35 | - } | ||
36 | - | ||
37 | expose(:params_environement) { | 32 | expose(:params_environement) { |
38 | params[:environment] | 33 | params[:environment] |
39 | } | 34 | } |
app/decorators/issue_tracker_decorator.rb
1 | +# Decorates an instance of IssueTracker | ||
1 | class IssueTrackerDecorator < Draper::Decorator | 2 | class IssueTrackerDecorator < Draper::Decorator |
2 | - | ||
3 | - def initialize(object, key) | ||
4 | - @object = object | ||
5 | - @key = key | ||
6 | - end | ||
7 | - attr_reader :key | ||
8 | - | ||
9 | delegate_all | 3 | delegate_all |
10 | 4 | ||
11 | - def issue_trackers | ||
12 | - ErrbitPlugin::Registry.issue_trackers.each do |key, object| | ||
13 | - yield IssueTrackerDecorator.new(object, key) | ||
14 | - end | ||
15 | - end | ||
16 | - | ||
17 | - def icons | ||
18 | - tracker_icons = object.icons | ||
19 | - return unless tracker_icons | ||
20 | - | ||
21 | - tracker_icons.reduce({}) do |c, (k,v)| | ||
22 | - c[k] = "data:#{v[0]};base64,#{Base64.encode64(v[1])}"; c | ||
23 | - end | ||
24 | - end | ||
25 | - | ||
26 | - def note | ||
27 | - object.note.html_safe | 5 | + def type |
6 | + @type ||= IssueTrackerTypeDecorator.new(object.tracker.class) | ||
28 | end | 7 | end |
29 | - | ||
30 | - def fields | ||
31 | - object.fields.each do |field, field_info| | ||
32 | - yield IssueTrackerFieldDecorator.new(field, field_info) | ||
33 | - end | ||
34 | - end | ||
35 | - | ||
36 | - def params_class(tracker) | ||
37 | - [chosen?(tracker), label].join(" ").strip | ||
38 | - end | ||
39 | - | ||
40 | - private | ||
41 | - | ||
42 | - def chosen?(issue_tracker) | ||
43 | - key == issue_tracker.type_tracker.to_s ? 'chosen' : '' | ||
44 | - end | ||
45 | - | ||
46 | end | 8 | end |
@@ -0,0 +1,30 @@ | @@ -0,0 +1,30 @@ | ||
1 | +# Decorates an IssueTracker class | ||
2 | +class IssueTrackerTypeDecorator < Draper::Decorator | ||
3 | + delegate_all | ||
4 | + | ||
5 | + # return hash of icons as data URIs | ||
6 | + def icons | ||
7 | + return unless object.icons | ||
8 | + | ||
9 | + object.icons.reduce({}) do |c, (k,v)| | ||
10 | + c[k] = "data:#{v[0]};base64,#{Base64.encode64(v[1])}"; c | ||
11 | + end | ||
12 | + end | ||
13 | + | ||
14 | + # class name for tracker type form fields | ||
15 | + # | ||
16 | + # 'chosen github' or 'bitbucket' for example | ||
17 | + def params_class(tracker) | ||
18 | + [object.label == tracker.type_tracker ? 'chosen' : '', label].join(" ").strip | ||
19 | + end | ||
20 | + | ||
21 | + def note | ||
22 | + object.note.html_safe | ||
23 | + end | ||
24 | + | ||
25 | + def fields | ||
26 | + object.fields.each do |field, field_info| | ||
27 | + yield IssueTrackerFieldDecorator.new(field, field_info) | ||
28 | + end | ||
29 | + end | ||
30 | +end |
app/helpers/application_helper.rb
@@ -69,6 +69,12 @@ module ApplicationHelper | @@ -69,6 +69,12 @@ module ApplicationHelper | ||
69 | collection.to_a[head_size..-1].to_a | 69 | collection.to_a[head_size..-1].to_a |
70 | end | 70 | end |
71 | 71 | ||
72 | + def issue_tracker_types | ||
73 | + ErrbitPlugin::Registry.issue_trackers.map do |_, object| | ||
74 | + IssueTrackerTypeDecorator.new(object) | ||
75 | + end | ||
76 | + end | ||
77 | + | ||
72 | private | 78 | private |
73 | def total_from_tallies(tallies) | 79 | def total_from_tallies(tallies) |
74 | tallies.values.inject(0) {|sum, n| sum + n} | 80 | tallies.values.inject(0) {|sum, n| sum + n} |
app/models/issue_tracker.rb
@@ -14,7 +14,10 @@ class IssueTracker | @@ -14,7 +14,10 @@ class IssueTracker | ||
14 | begin | 14 | begin |
15 | klass = ErrbitPlugin::Registry.issue_trackers[self.type_tracker] || ErrbitPlugin::NoneIssueTracker | 15 | klass = ErrbitPlugin::Registry.issue_trackers[self.type_tracker] || ErrbitPlugin::NoneIssueTracker |
16 | # TODO: we need to find out a better way to pass those config to the issue tracker | 16 | # TODO: we need to find out a better way to pass those config to the issue tracker |
17 | - klass.new(options.merge(github_repo: app.github_repo, bitbucket_repo: app.bitbucket_repo)) | 17 | + klass.new(options.merge( |
18 | + github_repo: app.try(:github_repo), | ||
19 | + bitbucket_repo: app.try(:bitbucket_repo) | ||
20 | + )) | ||
18 | end | 21 | end |
19 | end | 22 | end |
20 | 23 |
app/views/apps/_issue_tracker_fields.html.haml
@@ -3,16 +3,17 @@ | @@ -3,16 +3,17 @@ | ||
3 | = f.fields_for :issue_tracker do |issue_tracker_form| | 3 | = f.fields_for :issue_tracker do |issue_tracker_form| |
4 | %div.issue_tracker.nested | 4 | %div.issue_tracker.nested |
5 | %div.choose | 5 | %div.choose |
6 | - - issue_tracker_form.object.issue_trackers do |tracker| | ||
7 | - = issue_tracker_form.label :type_tracker, :class => "label_radio #{tracker.label}", :value => tracker.key do | ||
8 | - %img.icon{"src" => tracker.icons[:inactive], "data-icon" => tracker.icons} | ||
9 | - = issue_tracker_form.radio_button :type_tracker, tracker.key, 'data-section' => tracker.label | ||
10 | - = tracker.label | 6 | + - issue_tracker_types.each do |tracker_type| |
7 | + = issue_tracker_form.label :type_tracker, :class => "label_radio #{tracker_type.label}", :value => tracker_type.label do | ||
8 | + - icon = tracker_type == issue_tracker_form.object.type ? :create : :inactive | ||
9 | + %img.icon{"src" => tracker_type.icons[icon], "data-icon" => tracker_type.icons} | ||
10 | + = issue_tracker_form.radio_button :type_tracker, tracker_type.label, 'data-section' => tracker_type.label | ||
11 | + = tracker_type.label | ||
11 | 12 | ||
12 | - - issue_tracker_form.object.issue_trackers do |tracker| | ||
13 | - %div.tracker_params{:class => tracker.params_class(issue_tracker_form.object)} | 13 | + - issue_tracker_types.each do |tracker_type| |
14 | + %div.tracker_params{:class => tracker_type.params_class(issue_tracker_form.object)} | ||
14 | = issue_tracker_form.fields_for(:options) do |options_form| | 15 | = issue_tracker_form.fields_for(:options) do |options_form| |
15 | - %p= tracker.note | ||
16 | - - tracker.fields do |field| | 16 | + %p= tracker_type.note |
17 | + - tracker_type.fields do |field| | ||
17 | = options_form.label field.key, field.label | 18 | = options_form.label field.key, field.label |
18 | = field.input(options_form, issue_tracker_form.object) | 19 | = field.input(options_form, issue_tracker_form.object) |
app/views/apps/index.html.haml
@@ -36,7 +36,7 @@ | @@ -36,7 +36,7 @@ | ||
36 | - if any_issue_trackers? | 36 | - if any_issue_trackers? |
37 | %td.issue_tracker | 37 | %td.issue_tracker |
38 | - if app.issue_tracker_configured? | 38 | - if app.issue_tracker_configured? |
39 | - - tracker_img = image_tag("#{app.issue_tracker.type_tracker}_goto.png") | 39 | + - tracker_img = image_tag(app.issue_tracker.type.icons[:goto]) |
40 | - if app.issue_tracker.url | 40 | - if app.issue_tracker.url |
41 | = link_to( tracker_img, app.issue_tracker.url ) | 41 | = link_to( tracker_img, app.issue_tracker.url ) |
42 | - else | 42 | - else |
app/views/problems/_issue_tracker_links.html.haml
1 | - if app.issue_tracker_configured? | 1 | - if app.issue_tracker_configured? |
2 | + - tracker = app.issue_tracker | ||
3 | + - tracker_type = tracker.type | ||
2 | - if problem.issue_link.present? | 4 | - if problem.issue_link.present? |
3 | - %span= link_to 'go to issue', problem.issue_link, :class => "#{problem.issue_type}_goto goto-issue" | 5 | + %span |
6 | + %img.button-icon{"src" => tracker_type.icons[:create]} | ||
7 | + = link_to 'go to issue', problem.issue_link, :class => "goto-issue" | ||
4 | = link_to 'unlink issue', unlink_issue_app_problem_path(app, problem), :method => :delete, :data => { :confirm => "Unlink err issues?" }, :class => "unlink-issue" | 8 | = link_to 'unlink issue', unlink_issue_app_problem_path(app, problem), :method => :delete, :data => { :confirm => "Unlink err issues?" }, :class => "unlink-issue" |
5 | - elsif problem.issue_link == "pending" | 9 | - elsif problem.issue_link == "pending" |
6 | - %span.disabled= link_to 'creating...', '#', :class => "#{problem.issue_type}_inactive create-issue" | 10 | + %span.disabled |
11 | + %img.button-icon{"src" => tracker_type.icons[:inactive]} | ||
12 | + = link_to 'creating...', '#', :class => "create-issue" | ||
7 | = link_to 'retry', create_issue_app_problem_path(app, problem), :method => :post | 13 | = link_to 'retry', create_issue_app_problem_path(app, problem), :method => :post |
8 | - else | 14 | - else |
9 | - %span= link_to 'create issue', create_issue_app_problem_path(app, problem), method: :post, class: "#{app.issue_tracker.type_tracker}_create create-issue" | 15 | + %span |
16 | + %img.button-icon{"src" => tracker_type.icons[:goto]} | ||
17 | + = link_to 'create issue', create_issue_app_problem_path(app, problem), method: :post, :class => "create-issue" |
lib/tasks/errbit/demo.rake
1 | namespace :errbit do | 1 | namespace :errbit do |
2 | - | ||
3 | desc "Add a demo app & errors to your database (for testing)" | 2 | desc "Add a demo app & errors to your database (for testing)" |
4 | task :demo => :environment do | 3 | task :demo => :environment do |
4 | + require 'fabrication' | ||
5 | 5 | ||
6 | app = Fabricate(:app, :name => "Demo App #{Time.now.strftime("%N")}") | 6 | app = Fabricate(:app, :name => "Demo App #{Time.now.strftime("%N")}") |
7 | 7 | ||
@@ -68,5 +68,4 @@ namespace :errbit do | @@ -68,5 +68,4 @@ namespace :errbit do | ||
68 | Fabricate(:notice, :err => Fabricate(:err, :problem => Fabricate(:problem, :app => app))) | 68 | Fabricate(:notice, :err => Fabricate(:err, :problem => Fabricate(:problem, :app => app))) |
69 | puts "=== Created demo app: '#{app.name}', with example errors." | 69 | puts "=== Created demo app: '#{app.name}', with example errors." |
70 | end | 70 | end |
71 | - | ||
72 | end | 71 | end |
spec/controllers/problems_controller_spec.rb
@@ -218,9 +218,7 @@ describe ProblemsController, type: 'controller' do | @@ -218,9 +218,7 @@ describe ProblemsController, type: 'controller' do | ||
218 | @err = Fabricate(:err) | 218 | @err = Fabricate(:err) |
219 | end | 219 | end |
220 | 220 | ||
221 | - it 'finds the app and the err' do | ||
222 | - expect(App).to receive(:find).with(@err.app.id.to_s).and_return(@err.app) | ||
223 | - expect(@err.app.problems).to receive(:find).and_return(@err.problem) | 221 | + it 'finds the app and the problem' do |
224 | put :resolve, :app_id => @err.app.id, :id => @err.problem.id | 222 | put :resolve, :app_id => @err.app.id, :id => @err.problem.id |
225 | expect(controller.app).to eq @err.app | 223 | expect(controller.app).to eq @err.app |
226 | expect(controller.problem).to eq @err.problem | 224 | expect(controller.problem).to eq @err.problem |
spec/decorators/issue_tracker_decorator_spec.rb
1 | describe IssueTrackerDecorator do | 1 | describe IssueTrackerDecorator do |
2 | let(:fake_tracker) do | 2 | let(:fake_tracker) do |
3 | - Class.new(ErrbitPlugin::IssueTracker) do | 3 | + klass = Class.new(ErrbitPlugin::IssueTracker) { |
4 | def self.label; 'fake'; end | 4 | def self.label; 'fake'; end |
5 | def self.note; 'a note'; end | 5 | def self.note; 'a note'; end |
6 | def self.fields | 6 | def self.fields |
@@ -11,43 +11,23 @@ describe IssueTrackerDecorator do | @@ -11,43 +11,23 @@ describe IssueTrackerDecorator do | ||
11 | end | 11 | end |
12 | 12 | ||
13 | def configured?; true; end | 13 | def configured?; true; end |
14 | - end | 14 | + } |
15 | + klass.new 'nothing special' | ||
15 | end | 16 | end |
16 | 17 | ||
17 | - let(:decorator) do | ||
18 | - IssueTrackerDecorator.new(fake_tracker, 'fake') | 18 | + let(:issue_tracker) do |
19 | + it = IssueTracker.new | ||
20 | + allow(it).to receive(:tracker).and_return(fake_tracker) | ||
21 | + it | ||
19 | end | 22 | end |
20 | 23 | ||
21 | - describe "#note" do | ||
22 | - it 'return the html_safe of Note' do | ||
23 | - expect(decorator.note).to eql fake_tracker.note | ||
24 | - end | ||
25 | - end | ||
26 | - | ||
27 | - describe "#issue_trackers" do | ||
28 | - it 'return an array of IssueTrackerDecorator' do | ||
29 | - decorator.issue_trackers do |it| | ||
30 | - expect(it).to be_a(IssueTrackerDecorator) | ||
31 | - end | ||
32 | - end | ||
33 | - end | ||
34 | - | ||
35 | - describe "#fields" do | ||
36 | - it 'return all Fields define decorate' do | ||
37 | - decorator.fields do |itf| | ||
38 | - expect(itf).to be_a(IssueTrackerFieldDecorator) | ||
39 | - expect([:foo, :bar]).to be_include(itf.object) | ||
40 | - expect([{:label => 'foo'}, {:label => 'bar'}]).to be_include(itf.field_info) | ||
41 | - end | ||
42 | - end | 24 | + let(:decorator) do |
25 | + IssueTrackerDecorator.new(issue_tracker) | ||
43 | end | 26 | end |
44 | 27 | ||
45 | - describe "#params_class" do | ||
46 | - it 'add the label in class' do | ||
47 | - expect(decorator.params_class(IssueTracker.new(:type_tracker => 'none'))).to eql 'fake' | ||
48 | - end | ||
49 | - it 'add chosen class if _type is same' do | ||
50 | - expect(decorator.params_class(IssueTracker.new(:type_tracker => 'fake'))).to eql 'chosen fake' | 28 | + describe "#type" do |
29 | + it 'returns decorator for the issue tracker class' do | ||
30 | + expect(decorator.type.class).to eq(IssueTrackerTypeDecorator) | ||
51 | end | 31 | end |
52 | end | 32 | end |
53 | end | 33 | end |
@@ -0,0 +1,59 @@ | @@ -0,0 +1,59 @@ | ||
1 | +describe IssueTrackerDecorator do | ||
2 | + let(:fake_tracker_class) do | ||
3 | + klass = Class.new(ErrbitPlugin::IssueTracker) do | ||
4 | + def self.label; 'fake'; end | ||
5 | + def self.note; 'a note'; end | ||
6 | + def self.fields | ||
7 | + { | ||
8 | + :foo => {:label => 'foo'}, | ||
9 | + :bar => {:label => 'bar'} | ||
10 | + } | ||
11 | + end | ||
12 | + def self.icons | ||
13 | + { | ||
14 | + one: ['text/plain', 'all your base are belong to us'], | ||
15 | + two: ['application/xml', '<root></root>'], | ||
16 | + } | ||
17 | + end | ||
18 | + end | ||
19 | + | ||
20 | + allow(ErrbitPlugin::Registry).to receive(:issue_trackers).and_return({ | ||
21 | + fake: klass | ||
22 | + }) | ||
23 | + | ||
24 | + klass | ||
25 | + end | ||
26 | + | ||
27 | + let(:fake_tracker) { IssueTrackerDecorator.new(fake_tracker_class.new) } | ||
28 | + let(:decorator) { IssueTrackerTypeDecorator.new(fake_tracker_class) } | ||
29 | + | ||
30 | + describe "::note" do | ||
31 | + it 'return the html_safe of Note' do | ||
32 | + expect(decorator.note).to eql fake_tracker_class.note | ||
33 | + end | ||
34 | + end | ||
35 | + | ||
36 | + describe "#fields" do | ||
37 | + it 'return all Fields define decorate' do | ||
38 | + decorator.fields do |itf| | ||
39 | + expect(itf).to be_a(IssueTrackerFieldDecorator) | ||
40 | + expect([:foo, :bar]).to be_include(itf.object) | ||
41 | + expect([{:label => 'foo'}, {:label => 'bar'}]).to be_include(itf.field_info) | ||
42 | + end | ||
43 | + end | ||
44 | + end | ||
45 | + | ||
46 | + describe "#params_class" do | ||
47 | + it 'adds the label in class' do | ||
48 | + tracker = IssueTrackerDecorator.new(IssueTracker.new( | ||
49 | + type_tracker: 'none')) | ||
50 | + expect(decorator.params_class(tracker)).to eql 'fake' | ||
51 | + end | ||
52 | + | ||
53 | + it 'adds chosen class if type is same' do | ||
54 | + expect(decorator.params_class( | ||
55 | + IssueTracker.new(type_tracker: 'fake').decorate | ||
56 | + )).to eql 'chosen fake' | ||
57 | + end | ||
58 | + end | ||
59 | +end |
spec/views/problems/show.html.haml_spec.rb
@@ -4,12 +4,14 @@ describe "problems/show.html.haml", type: 'view' do | @@ -4,12 +4,14 @@ describe "problems/show.html.haml", type: 'view' do | ||
4 | let(:pivotal_tracker) { | 4 | let(:pivotal_tracker) { |
5 | Class.new(ErrbitPlugin::MockIssueTracker) do | 5 | Class.new(ErrbitPlugin::MockIssueTracker) do |
6 | def self.label; 'pivotal'; end | 6 | def self.label; 'pivotal'; end |
7 | + def self.icons; {}; end | ||
7 | def configured?; true; end | 8 | def configured?; true; end |
8 | end | 9 | end |
9 | } | 10 | } |
10 | let(:github_tracker) { | 11 | let(:github_tracker) { |
11 | Class.new(ErrbitPlugin::MockIssueTracker) do | 12 | Class.new(ErrbitPlugin::MockIssueTracker) do |
12 | - def label; 'github'; end | 13 | + def self.label; 'github'; end |
14 | + def self.icons; {}; end | ||
13 | def configured?; true; end | 15 | def configured?; true; end |
14 | end | 16 | end |
15 | } | 17 | } |
@@ -19,9 +21,10 @@ describe "problems/show.html.haml", type: 'view' do | @@ -19,9 +21,10 @@ describe "problems/show.html.haml", type: 'view' do | ||
19 | 'pivotal' => pivotal_tracker | 21 | 'pivotal' => pivotal_tracker |
20 | } | 22 | } |
21 | } | 23 | } |
24 | + let(:app) { AppDecorator.new(problem.app) } | ||
22 | 25 | ||
23 | before do | 26 | before do |
24 | - allow(view).to receive(:app).and_return(problem.app) | 27 | + allow(view).to receive(:app).and_return(app) |
25 | allow(view).to receive(:problem).and_return(problem) | 28 | allow(view).to receive(:problem).and_return(problem) |
26 | 29 | ||
27 | assign :comment, comment | 30 | assign :comment, comment |
@@ -33,7 +36,11 @@ describe "problems/show.html.haml", type: 'view' do | @@ -33,7 +36,11 @@ describe "problems/show.html.haml", type: 'view' do | ||
33 | 36 | ||
34 | def with_issue_tracker(tracker, problem) | 37 | def with_issue_tracker(tracker, problem) |
35 | allow(ErrbitPlugin::Registry).to receive(:issue_trackers).and_return(trackers) | 38 | allow(ErrbitPlugin::Registry).to receive(:issue_trackers).and_return(trackers) |
36 | - problem.app.issue_tracker = IssueTracker.new :type_tracker => tracker, :options => {:api_token => "token token token", :project_id => "1234"} | 39 | + app.issue_tracker = IssueTrackerDecorator.new( |
40 | + IssueTracker.new :type_tracker => tracker, :options => { | ||
41 | + :api_token => "token token token", | ||
42 | + :project_id => "1234" | ||
43 | + }) | ||
37 | end | 44 | end |
38 | 45 | ||
39 | describe "content_for :action_bar" do | 46 | describe "content_for :action_bar" do |
@@ -86,7 +93,7 @@ describe "problems/show.html.haml", type: 'view' do | @@ -86,7 +93,7 @@ describe "problems/show.html.haml", type: 'view' do | ||
86 | allow(view).to receive(:app).and_return(problem.app) | 93 | allow(view).to receive(:app).and_return(problem.app) |
87 | render | 94 | render |
88 | 95 | ||
89 | - expect(action_bar).to have_selector("span a.github_create.create-issue", text: 'create issue') | 96 | + expect(action_bar).to have_selector("span a.create-issue", text: 'create issue') |
90 | end | 97 | end |
91 | 98 | ||
92 | context "without issue tracker associate on app" do | 99 | context "without issue tracker associate on app" do |
@@ -118,12 +125,7 @@ describe "problems/show.html.haml", type: 'view' do | @@ -118,12 +125,7 @@ describe "problems/show.html.haml", type: 'view' do | ||
118 | 125 | ||
119 | it 'links to the associated tracker' do | 126 | it 'links to the associated tracker' do |
120 | render | 127 | render |
121 | - expect(view.content_for(:action_bar)).to match(".pivotal_create.create-issue") | ||
122 | - end | ||
123 | - | ||
124 | - it 'does not link to github' do | ||
125 | - render | ||
126 | - expect(view.content_for(:action_bar)).to_not match(".github_create.create-issue") | 128 | + expect(view.content_for(:action_bar)).to match(".create-issue") |
127 | end | 129 | end |
128 | end | 130 | end |
129 | 131 | ||
@@ -179,4 +181,3 @@ describe "problems/show.html.haml", type: 'view' do | @@ -179,4 +181,3 @@ describe "problems/show.html.haml", type: 'view' do | ||
179 | end | 181 | end |
180 | end | 182 | end |
181 | end | 183 | end |
182 | - |