Skip to content

Commit

Permalink
Update deprecated specs and avoid breaking core tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nanego committed Jun 1, 2015
1 parent f64e8e5 commit ab1b4bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/views/redmine_auto_private/_form.html.erb
@@ -1,5 +1,5 @@
<p style="float:right;margin-right:0.5em;">
<% if @project.force_private_issues? %>
<% if @issue.project.force_private_issues? %>
<%= hidden_field_tag 'issue[is_private]', 1 %>
<span style="text-transform:uppercase;background:#d22;color:#fff;font-weight:bold;padding:2px 4px;font-size:90%;border-radius:2px;"><%= l(:field_is_private) %></span>
<% else %>
Expand Down
12 changes: 6 additions & 6 deletions spec/controllers/issues_controller_auto_private_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'

describe IssuesController do
describe IssuesController, :type => :controller do
render_views
fixtures :projects, :users, :roles, :members, :member_roles, :issues, :issue_statuses, :versions,
:trackers, :projects_trackers, :issue_categories, :enabled_modules, :enumerations, :attachments,
Expand All @@ -20,15 +20,15 @@
it "should keeps checkbox if auto-private flag not set" do
Issue.find(1).project.update_attribute(:force_private_issues, false)
get :show, :id => 1
response.should be_success
assert_tag "input", :attributes => {:name => "issue[is_private]", :type => "checkbox"}
expect(response).to be_success
assert_select "input[name='issue[is_private]'][type='checkbox']"
end

it "should set private flag for issues" do
Issue.find(1).project.update_attribute(:force_private_issues, true)
get :show, :id => 1
response.should be_success
assert_no_tag "input", :attributes => {:name => "issue[is_private]", :type => "checkbox"}
assert_tag "input", :attributes => {:name => "issue[is_private]", :type => "hidden", :value => "1"}
expect(response).to be_success
assert_select "input[name='issue[is_private]'][type='checkbox']", false
assert_select "input[name='issue[is_private]'][type='hidden'][value='1']"
end
end

0 comments on commit ab1b4bd

Please sign in to comment.