Commit 67b9fa51dcdf3d5954b83f6f162763349d1e662a

Authored by Dmitriy Zaporozhets
1 parent 60f083ad

fixed tests

app/controllers/issues_controller.rb
... ... @@ -47,6 +47,7 @@ class IssuesController < ApplicationController
47 47 def create
48 48 @issue = @project.issues.new(params[:issue])
49 49 @issue.author = current_user
  50 +
50 51 if @issue.save && @issue.assignee != current_user
51 52 Notify.new_issue_email(@issue).deliver
52 53 end
... ...
app/views/issues/_show.html.haml
... ... @@ -24,6 +24,6 @@
24 24 - else
25 25 = link_to 'Resolve', project_issue_path(@project, issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "cgray", :remote => true
26 26 - if can? current_user, :write_issue, issue
27   - = link_to 'Edit', edit_project_issue_path(@project, issue), :class => "cgray", :remote => true
  27 + = link_to 'Edit', edit_project_issue_path(@project, issue), :class => "cgray edit-issue-link", :remote => true
28 28 - if can?(current_user, :admin_issue, @project) || issue.author == current_user
29 29 = link_to 'Destroy', [@project, issue], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "cred delete-issue negative", :id => "destroy_issue_#{issue.id}"
... ...
app/views/issues/create.js.haml
1 1 - if @issue.valid?
2 2 :plain
3 3 $("#new_issue_dialog").dialog("close");
  4 + $("#issues-table").prepend("#{escape_javascript(render(:partial => 'show', :locals => {:issue => @issue} ))}");
4 5 $.ajax({type: "GET", url: location.href, dataType: "script"});
5 6 - else
6 7 :plain
... ...
spec/requests/issues_spec.rb
... ... @@ -169,6 +169,7 @@ describe "Issues" do
169 169 :assignee => @user,
170 170 :project => project
171 171 visit project_issues_path(project)
  172 + page.execute_script("$('.action-links').css('display', 'block');")
172 173 click_link "Edit"
173 174 end
174 175  
... ...