Commit 67b9fa51 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

fixed tests

parent 60f083ad
...@@ -47,6 +47,7 @@ class IssuesController < ApplicationController ...@@ -47,6 +47,7 @@ class IssuesController < ApplicationController
def create def create
@issue = @project.issues.new(params[:issue]) @issue = @project.issues.new(params[:issue])
@issue.author = current_user @issue.author = current_user
if @issue.save && @issue.assignee != current_user if @issue.save && @issue.assignee != current_user
Notify.new_issue_email(@issue).deliver Notify.new_issue_email(@issue).deliver
end end
......
...@@ -24,6 +24,6 @@ ...@@ -24,6 +24,6 @@
- else - else
= link_to 'Resolve', project_issue_path(@project, issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "cgray", :remote => true = link_to 'Resolve', project_issue_path(@project, issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "cgray", :remote => true
- if can? current_user, :write_issue, issue - if can? current_user, :write_issue, issue
= link_to 'Edit', edit_project_issue_path(@project, issue), :class => "cgray", :remote => true = link_to 'Edit', edit_project_issue_path(@project, issue), :class => "cgray edit-issue-link", :remote => true
- if can?(current_user, :admin_issue, @project) || issue.author == current_user - if can?(current_user, :admin_issue, @project) || issue.author == current_user
= link_to 'Destroy', [@project, issue], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "cred delete-issue negative", :id => "destroy_issue_#{issue.id}" = link_to 'Destroy', [@project, issue], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "cred delete-issue negative", :id => "destroy_issue_#{issue.id}"
- if @issue.valid? - if @issue.valid?
:plain :plain
$("#new_issue_dialog").dialog("close"); $("#new_issue_dialog").dialog("close");
$("#issues-table").prepend("#{escape_javascript(render(:partial => 'show', :locals => {:issue => @issue} ))}");
$.ajax({type: "GET", url: location.href, dataType: "script"}); $.ajax({type: "GET", url: location.href, dataType: "script"});
- else - else
:plain :plain
......
...@@ -169,6 +169,7 @@ describe "Issues" do ...@@ -169,6 +169,7 @@ describe "Issues" do
:assignee => @user, :assignee => @user,
:project => project :project => project
visit project_issues_path(project) visit project_issues_path(project)
page.execute_script("$('.action-links').css('display', 'block');")
click_link "Edit" click_link "Edit"
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment