Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Masquage du champ Statut lorsqu'il n'est pas modifiable : déplacer du plugin SCN vers TinyFeatures #27

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions app/overrides/issues/_attributes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Deface::Override.new :virtual_path => "issues/_attributes",
:name => "hide_read_only_status_field",
:original => '8c07bc5c6125db54af3873465088717987a73827',
:remove => "p:contains('l(:field_status)')"

Deface::Override.new :virtual_path => "issues/_form_with_positions",
:name => "hide_read_only_status_field",
:original => '8c07bc5c6125db54af3873465088717987a73827',
:remove => "p:contains('l(:field_status)')"
22 changes: 22 additions & 0 deletions spec/system/issues_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,26 @@ def log_user(login, password)
expect(options).to eq (options.sort_by(&:parameterize))
end
end

describe "status field" do
let (:issue_test) { Issue.find(9) }

before do
visit 'logout/'
find('input[name=commit]').click
log_user('jsmith', 'jsmith')
end

it "Should hide the Status field when it is not editable" do
WorkflowTransition.delete_all
issue_test
visit "/issues/#{issue_test.id}/edit"
expect(page).to_not have_selector('label', text: "Status")
end

it "Should show the Status field when it is editable" do
visit "/issues/#{issue_test.id}/edit"
expect(page).to have_selector('label', text: "Status *")
end
end
end
Loading