Commit 67b9fa51dcdf3d5954b83f6f162763349d1e662a

Authored by Dmitriy Zaporozhets
1 parent 60f083ad

fixed tests

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