=link_to'Reopen',project_issue_path(issue.project,issue,:issue=>{:closed=>false},:status_only=>true),:method=>:put,:class=>"btn small grouped reopen_issue",:remote=>true
=link_to'Reopen',project_issue_path(issue.project,issue,issue: {closed: false},status_only: true),method: :put,class: "btn small grouped reopen_issue",remote:true
-else
=link_to'Resolve',project_issue_path(issue.project,issue,:issue=>{:closed=>true},:status_only=>true),:method=>:put,:class=>"success btn small grouped close_issue",:remote=>true
=link_toedit_project_issue_path(issue.project,issue),:class=>"btn small edit-issue-link",:remote=>truedo
=link_to'Resolve',project_issue_path(issue.project,issue,issue: {closed: true},status_only: true),method: :put,class: "success btn small grouped close_issue",remote:true
=link_toedit_project_issue_path(issue.project,issue),class: "btn small edit-issue-link",remote:truedo
=auto_discovery_link_tag(:atom,project_commits_url(@project,:atom,:ref=>@ref,:private_token=>current_user.private_token),:title=>"Recent commits to #{@project.name}:#{@ref}")
=auto_discovery_link_tag(:atom,project_commits_url(@project,:atom,ref: @ref,private_token: current_user.private_token),title:"Recent commits to #{@project.name}:#{@ref}")
.right=link_to'Destroy',[@project,@snippet],:confirm=>'Are you sure?',:method=>:delete,:class=>"btn right danger delete-snippet",:id=>"destroy_snippet_#{@snippet.id}"
.right=link_to'Destroy',[@project,@snippet],confirm: 'Are you sure?',method: :delete,class: "btn right danger delete-snippet",id:"destroy_snippet_#{@snippet.id}"
=link_to'Remove from team',project_team_member_path(:project_id=>@project,:id=>@team_member.id),:confirm=>'Are you sure?',:method=>:delete,:class=>"right btn btn-danger"
=link_to'Remove from team',project_team_member_path(project_id: @project,id: @team_member.id),confirm: 'Are you sure?',method: :delete,class:"right btn btn-danger"
@@ -18,15 +18,15 @@ describe GitlabMarkdownHelper do
describe"referencing a commit"do
it"should link using a full id"do
gfm("Reverts changes from #{@commit.id}").should=="Reverts changes from #{link_to@commit.id,project_commit_path(@project,:id=>@commit.id),:title=>"Commit: #{@commit.author_name} - #{@commit.title}",:class=>"gfm gfm-commit "}"
gfm("Reverts changes from #{@commit.id}").should=="Reverts changes from #{link_to@commit.id,project_commit_path(@project,id: @commit.id),title: "Commit: #{@commit.author_name} - #{@commit.title}",class:"gfm gfm-commit "}"
end
it"should link using a short id"do
gfm("Backported from #{@commit.id[0,6]}").should=="Backported from #{link_to@commit.id[0,6],project_commit_path(@project,:id=>@commit.id),:title=>"Commit: #{@commit.author_name} - #{@commit.title}",:class=>"gfm gfm-commit "}"
gfm("Backported from #{@commit.id[0,6]}").should=="Backported from #{link_to@commit.id[0,6],project_commit_path(@project,id: @commit.id),title: "Commit: #{@commit.author_name} - #{@commit.title}",class:"gfm gfm-commit "}"
end
it"should link with adjecent text"do
gfm("Reverted (see #{@commit.id})").should=="Reverted (see #{link_to@commit.id,project_commit_path(@project,:id=>@commit.id),:title=>"Commit: #{@commit.author_name} - #{@commit.title}",:class=>"gfm gfm-commit "})"
gfm("Reverted (see #{@commit.id})").should=="Reverted (see #{link_to@commit.id,project_commit_path(@project,id: @commit.id),title: "Commit: #{@commit.author_name} - #{@commit.title}",class:"gfm gfm-commit "})"
end
it"should not link with an invalid id"do
...
...
@@ -38,33 +38,33 @@ describe GitlabMarkdownHelper do
gfm("@#{user.name} you are right").should=="#{link_to"@#{user.name}",project_team_member_path(@project,member),:class=>"gfm gfm-team_member "} you are right"
gfm("@#{user.name} you are right").should=="#{link_to"@#{user.name}",project_team_member_path(@project,member),class:"gfm gfm-team_member "} you are right"
gfm("@#{user.name} you are right").should=="#{link_to"@#{user.name}",project_team_member_path(@project,member),:class=>"gfm gfm-team_member "} you are right"
gfm("@#{user.name} you are right").should=="#{link_to"@#{user.name}",project_team_member_path(@project,member),class:"gfm gfm-team_member "} you are right"
gfm("@#{user.name} you are right").should=="#{link_to"@#{user.name}",project_team_member_path(@project,member),:class=>"gfm gfm-team_member "} you are right"
gfm("@#{user.name} you are right").should=="#{link_to"@#{user.name}",project_team_member_path(@project,member),class:"gfm gfm-team_member "} you are right"
gfm("Mail the Admin (@#{user.name})").should=="Mail the Admin (#{link_to"@#{user.name}",project_team_member_path(@project,member),:class=>"gfm gfm-team_member "})"
gfm("Mail the Admin (@#{user.name})").should=="Mail the Admin (#{link_to"@#{user.name}",project_team_member_path(@project,member),class:"gfm gfm-team_member "})"
end
it"should add styles"do
...
...
@@ -80,16 +80,16 @@ describe GitlabMarkdownHelper do
gfm("This has already been discussed (see ##{@issue.id})").should=="This has already been discussed (see #{link_to"##{@issue.id}",project_issue_path(@project,@issue),:title=>"Issue: #{@issue.title}",:class=>"gfm gfm-issue "})"
gfm("This has already been discussed (see ##{@issue.id})").should=="This has already been discussed (see #{link_to"##{@issue.id}",project_issue_path(@project,@issue),title: "Issue: #{@issue.title}",class:"gfm gfm-issue "})"
end
it"should add styles"do
...
...
@@ -103,16 +103,16 @@ describe GitlabMarkdownHelper do
gfm("Fixed in !#{@merge_request.id}").should=="Fixed in #{link_to"!#{@merge_request.id}",project_merge_request_path(@project,@merge_request),:title=>"Merge Request: #{@merge_request.title}",:class=>"gfm gfm-merge_request "}"
gfm("Fixed in !#{@merge_request.id}").should=="Fixed in #{link_to"!#{@merge_request.id}",project_merge_request_path(@project,@merge_request),title: "Merge Request: #{@merge_request.title}",class:"gfm gfm-merge_request "}"
end
it"should link with adjecent text"do
gfm("This has been fixed already (see !#{@merge_request.id})").should=="This has been fixed already (see #{link_to"!#{@merge_request.id}",project_merge_request_path(@project,@merge_request),:title=>"Merge Request: #{@merge_request.title}",:class=>"gfm gfm-merge_request "})"
gfm("This has been fixed already (see !#{@merge_request.id})").should=="This has been fixed already (see #{link_to"!#{@merge_request.id}",project_merge_request_path(@project,@merge_request),title: "Merge Request: #{@merge_request.title}",class:"gfm gfm-merge_request "})"
end
it"should add styles"do
...
...
@@ -127,17 +127,17 @@ describe GitlabMarkdownHelper do
describe"referencing a snippet"do
beforedo
@snippet=Factory.create(:snippet,
:title=>"Render asset to string",
:author=>@fake_user,
:project=>@project)
title:"Render asset to string",
author:@fake_user,
project:@project)
end
it"should link using a correct id"do
gfm("Check out $#{@snippet.id}").should=="Check out #{link_to"$#{@snippet.id}",project_snippet_path(@project,@snippet),:title=>"Snippet: #{@snippet.title}",:class=>"gfm gfm-snippet "}"
gfm("Check out $#{@snippet.id}").should=="Check out #{link_to"$#{@snippet.id}",project_snippet_path(@project,@snippet),title: "Snippet: #{@snippet.title}",class:"gfm gfm-snippet "}"
end
it"should link with adjecent text"do
gfm("I have created a snippet for that ($#{@snippet.id})").should=="I have created a snippet for that (#{link_to"$#{@snippet.id}",project_snippet_path(@project,@snippet),:title=>"Snippet: #{@snippet.title}",:class=>"gfm gfm-snippet "})"
gfm("I have created a snippet for that ($#{@snippet.id})").should=="I have created a snippet for that (#{link_to"$#{@snippet.id}",project_snippet_path(@project,@snippet),title: "Snippet: #{@snippet.title}",class:"gfm gfm-snippet "})"
end
it"should add styles"do
...
...
@@ -152,12 +152,12 @@ describe GitlabMarkdownHelper do
gfm("Let @#{user.name} fix the *mess* in #{@commit.id}").should=="Let #{link_to"@#{user.name}",project_team_member_path(@project,member),:class=>"gfm gfm-team_member "} fix the *mess* in #{link_to@commit.id,project_commit_path(@project,:id=>@commit.id),:title=>"Commit: #{@commit.author_name} - #{@commit.title}",:class=>"gfm gfm-commit "}"
gfm("Let @#{user.name} fix the *mess* in #{@commit.id}").should=="Let #{link_to"@#{user.name}",project_team_member_path(@project,member),class: "gfm gfm-team_member "} fix the *mess* in #{link_to@commit.id,project_commit_path(@project,id: @commit.id),title: "Commit: #{@commit.author_name} - #{@commit.title}",class:"gfm gfm-commit "}"
end
it"should not trip over other stuff",:focus=>truedo
it"should not trip over other stuff",focus:truedo
gfm("_Please_ *stop* 'helping' and all the other b*$#%' you do.").should=="_Please_ *stop* 'helping' and all the other b*$#%' you do."
end
...
...
@@ -166,57 +166,57 @@ describe GitlabMarkdownHelper do
end
it"should forward HTML options to links"do
gfm("fixed in #{@commit.id}",:class=>"foo").shouldhave_selector("a.foo")
gfm("fixed in #{@commit.id}",class:"foo").shouldhave_selector("a.foo")
it"should handle references nested in links with all the text"do
link_to_gfm("This should finally fix ##{issue1.id} and ##{issue2.id} for real",project_commit_path(@project,:id=>@commit.id)).should=="#{link_to"This should finally fix ",project_commit_path(@project,:id=>@commit.id)}#{link_to"##{issue1.id}",project_issue_path(@project,issue1),:title=>"Issue: #{issue1.title}",:class=>"gfm gfm-issue "}#{link_to" and ",project_commit_path(@project,:id=>@commit.id)}#{link_to"##{issue2.id}",project_issue_path(@project,issue2),:title=>"Issue: #{issue2.title}",:class=>"gfm gfm-issue "}#{link_to" for real",project_commit_path(@project,:id=>@commit.id)}"
link_to_gfm("This should finally fix ##{issue1.id} and ##{issue2.id} for real",project_commit_path(@project,id: @commit.id)).should=="#{link_to"This should finally fix ",project_commit_path(@project,id: @commit.id)}#{link_to"##{issue1.id}",project_issue_path(@project,issue1),title: "Issue: #{issue1.title}",class: "gfm gfm-issue "}#{link_to" and ",project_commit_path(@project,id: @commit.id)}#{link_to"##{issue2.id}",project_issue_path(@project,issue2),title: "Issue: #{issue2.title}",class: "gfm gfm-issue "}#{link_to" for real",project_commit_path(@project,id:@commit.id)}"
end
it"should forward HTML options"do
link_to_gfm("This should finally fix ##{issue1.id} for real",project_commit_path(@project,:id=>@commit.id),:class=>"foo").shouldhave_selector(".foo")
link_to_gfm("This should finally fix ##{issue1.id} for real",project_commit_path(@project,id: @commit.id),class:"foo").shouldhave_selector(".foo")
markdown("\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. #{@commit.id} Nam pulvinar sapien eget odio adipiscing at faucibus orci vestibulum.\n").should=="<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. #{link_to@commit.id,project_commit_path(@project,:id=>@commit.id),:title=>"Commit: #{@commit.author_name} - #{@commit.title}",:class=>"gfm gfm-commit "} Nam pulvinar sapien eget odio adipiscing at faucibus orci vestibulum.</p>\n"
markdown("\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. #{@commit.id} Nam pulvinar sapien eget odio adipiscing at faucibus orci vestibulum.\n").should=="<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. #{link_to@commit.id,project_commit_path(@project,id: @commit.id),title: "Commit: #{@commit.author_name} - #{@commit.title}",class:"gfm gfm-commit "} Nam pulvinar sapien eget odio adipiscing at faucibus orci vestibulum.</p>\n"
end
it"should handle references in headers"do
markdown("\n# Working around ##{@issue.id} for now\n## Apply !#{@merge_request.id}").should=="<h1 id=\"toc_0\">Working around #{link_to"##{@issue.id}",project_issue_path(@project,@issue),:title=>"Issue: #{@issue.title}",:class=>"gfm gfm-issue "} for now</h1>\n\n<h2 id=\"toc_1\">Apply #{link_to"!#{@merge_request.id}",project_merge_request_path(@project,@merge_request),:title=>"Merge Request: #{@merge_request.title}",:class=>"gfm gfm-merge_request "}</h2>\n"
markdown("\n# Working around ##{@issue.id} for now\n## Apply !#{@merge_request.id}").should=="<h1 id=\"toc_0\">Working around #{link_to"##{@issue.id}",project_issue_path(@project,@issue),title: "Issue: #{@issue.title}",class: "gfm gfm-issue "} for now</h1>\n\n<h2 id=\"toc_1\">Apply #{link_to"!#{@merge_request.id}",project_merge_request_path(@project,@merge_request),title: "Merge Request: #{@merge_request.title}",class:"gfm gfm-merge_request "}</h2>\n"
end
it"should handle references in lists"do
markdown("\n* dark: ##{@issue.id}\n* light by @#{@other_user.name}\n").should=="<ul>\n<li>dark: #{link_to"##{@issue.id}",project_issue_path(@project,@issue),:title=>"Issue: #{@issue.title}",:class=>"gfm gfm-issue "}</li>\n<li>light by #{link_to"@#{@other_user.name}",project_team_member_path(@project,@member),:class=>"gfm gfm-team_member "}</li>\n</ul>\n"
markdown("\n* dark: ##{@issue.id}\n* light by @#{@other_user.name}\n").should=="<ul>\n<li>dark: #{link_to"##{@issue.id}",project_issue_path(@project,@issue),title: "Issue: #{@issue.title}",class: "gfm gfm-issue "}</li>\n<li>light by #{link_to"@#{@other_user.name}",project_team_member_path(@project,@member),class:"gfm gfm-team_member "}</li>\n</ul>\n"