Project

General

Profile

Feature #33730 » feature-33730.patch

Mizuki ISHIKAWA, 2020-07-14 08:30

View differences:

app/views/versions/index.html.erb
<div id="roadmap">
<% @versions.each do |version| %>
<article class="version-article <%= version.css_classes %>">
<% if User.current.allowed_to?(:manage_versions, version.project) %>
<div class="contextual">
<div class="contextual">
<%= link_to_new_issue(version, version.project) %>
<% if User.current.allowed_to?(:manage_versions, version.project) %>
<%= link_to l(:button_edit), edit_version_path(version), :title => l(:button_edit), :class => 'icon-only icon-edit' %>
</div>
<% end %>
<% end %>
</div>
<header>
<h3 class="icon icon-package version inline-flex"><%= link_to_version version, :name => version_anchor(version) %></h3>
<span class="badge badge-status-<%= version.status %>"><%= l("version_status_#{version.status}") %></span>
test/functional/versions_controller_test.rb
end
end
def test_index_should_show_contextual
@request.session[:user_id] = 1
get :index, :params => {:project_id => 1, :completed => 1}
assert_response :success
assert_select 'article.version-open .contextual' do
assert_select 'a.icon.icon-add', :text => 'New issue'
assert_select 'a.icon-only.icon-edit'
end
assert_select 'article.version-locked .contextual' do
assert_select 'a.icon.icon-add', :text => 'New issue', :count => 0
assert_select 'a.icon-only.icon-edit'
end
assert_select 'article.version-closed .contextual' do
assert_select 'a.icon.icon-add', :text => 'New issue', :count => 0
assert_select 'a.icon-only.icon-edit'
end
end
def test_show
with_settings :gravatar_enabled => '0' do
get :show, :params => {:id => 2}
(2-2/5)