Fix project spec

pull/4323/head
Oliver Günther 8 years ago
parent 15d81c1a0c
commit 9f3c36eb1a
  1. 5
      app/assets/javascripts/application.js.erb
  2. 4
      app/helpers/application_helper.rb
  3. 9
      spec/features/time_entry/time_entry_report_spec.rb

@ -197,14 +197,15 @@ function generateProjectIdentifier() {
function observeProjectName() {
jQuery('#project_name').keyup(function() {
if(!projectIdentifierLocked) {
jQuery('project_identifier').setValue(generateProjectIdentifier());
jQuery('#project_identifier').val(generateProjectIdentifier());
}
});
}
function observeProjectIdentifier() {
jQuery('#project_identifier').keyup(function() {
if($('project_identifier').getValue() !== '' && $('project_identifier').getValue() != generateProjectIdentifier()) {
if(jQuery('#project_identifier').getValue() !== '' &&
jQuery('#project_identifier').getValue() != generateProjectIdentifier()) {
projectIdentifierLocked = true;
} else {
projectIdentifierLocked = false;

@ -68,8 +68,8 @@ module ApplicationHelper
end
def link_to_function(content, function, html_options = {})
onclick = "#{function}; return false;"
content_tag(:a, content, html_options.merge(onclick: onclick))
onclick = "#{function}; return false;"
content_tag(:a, content, html_options.merge(onclick: onclick))
end
def required_field_name(name = '')

@ -43,10 +43,10 @@ describe 'time entry report', type: :feature, js: true do
let(:work_package2) { FactoryGirl.create(:work_package, project: project2) }
let!(:project_time_entry2) {
FactoryGirl.create(:time_entry,
project: project2,
spent_on: 1.year.ago,
work_package: work_package2,
hours: 5.0)
project: project2,
spent_on: 1.year.ago,
work_package: work_package2,
hours: 5.0)
}
let(:user) { FactoryGirl.create(:admin) }
@ -66,7 +66,6 @@ describe 'time entry report', type: :feature, js: true do
end
end
context 'for all projects' do
before do
visit time_entries_path

Loading…
Cancel
Save