Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Merge requests
  • !7572

Merged
Created Aug 22, 2014 by Administrator@rootOwner

Handle undefined text area values

  • Overview 7
  • Commits 1
  • Changes 1

Created by: mr-vinn

Check to see if a text area's val is defined before trying to call replace() on it.

This was causing failures in RSpec tests; here's a snippet of output from bundle exec rspec spec/features/notes_on_merge_requests_spec.rb:

Failures:

  1) Comments On a merge request the note form should be valid
     Failure/Error: visit project_merge_request_path(project, merge_request)
     Capybara::Poltergeist::JavascriptError:
       One or more errors were raised in the Javascript code on the page. If you don't care about these errors, you can ignore them by setting js_errors: false in your Poltergeist configuration (see documentation for details).

       TypeError: 'undefined' is not an object (evaluating 'val.replace')
       TypeError: 'undefined' is not an object (evaluating 'val.replace')
           at http://127.0.0.1:58906/assets/application.js:76468
           at http://127.0.0.1:58906/assets/application.js:76475
           at http://127.0.0.1:58906/assets/application.js:74482 in MergeRequest
           at http://127.0.0.1:58906/namespace1/gitlabhq/merge_requests/1:553
     # ./spec/features/notes_on_merge_requests_spec.rb:13:in `block (3 levels) in <top (required)>'
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: github/fork/mr-vinn/application-js-fix