Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6880065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:55:36+00:00 2026-05-27T04:55:36+00:00

I am building a backbone.js app on a Rails 3.1 back-end. I’m using CoffeeScript

  • 0

I am building a backbone.js app on a Rails 3.1 back-end. I’m using CoffeeScript to write the backbone classes, and Jasmine (via jasmine-headless-webkit) for testing.

Given the following (partial) tree:

.
├── app
│   ├── assets
│   │   ├── javascripts
│   │   │   └── views
│   │   │       ├── avia_view.js.coffee
├── spec
│   ├── javascripts
│   │   └── views
│   │       └── avia_view_spec.js.coffee

… I would expect avia_view_spec.js.coffee to know about Avia.AviaView, which is defined in avia_view.js.coffee.

However, I get the following output from running bundle exec jasmine-headless-webkit:

Running Jasmine specs...
F

Avia.AviaView render creates a new MatricesView . (/home/duncan/avia/spec/javascripts/views/avia_view_spec.js.coffee:10)
  ReferenceError: Can't find variable: Avia in /home/duncan/avia/spec/javascripts/views/avia_view_spec.js.coffee (line ~5)
  ReferenceError: Can't find variable: Avia in /home/duncan/avia/spec/javascripts/views/avia_view_spec.js.coffee (line ~10)

My jasmine.yml contains the following:

src_files:
  - public/javascripts/prototype.js
  - public/javascripts/effects.js
  - public/javascripts/controls.js
  - public/javascripts/dragdrop.js
  - public/javascripts/application.js
  - public/javascripts/**/*.js

I think I need to tell Jasmine to load the contents of avia_view.js.coffee but I’m not entirely sure how. Adding an explicit reference in the src_files section in jasmine.yml doesn’t seem to make a difference …

Could someone please tell me what I’m doing wrong here? I suspect it’s something simple …

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:55:37+00:00Added an answer on May 27, 2026 at 4:55 am

    Without having seen to much of your code, I’d suspect it beacuse of CoffeeScript’s function wrapping (docs). You need to ensure that all the symbols you want to use are exported to somewhere you can get at them (here is a thorough discussion about that).

    Edit: here’s another longish and theoretical but good documentation on this topic.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building an app using Brunch and Backbone.js that is to include nested menus.
I am building a js heavy app using backbone.js. One problem I've run into
I'm new to the world of coffeescript (javascript). Currently building my first backbone.js app
Building a sample ASP.NET MVC app. Using the Membership API for authentication. For whatever
I'm building my first Backbone.js app and I'm confused about how much responsibility I'm
I'm learning Backbone.js for a new app I'm building. I need to perform an
I'm building one page application using Backbone's router to modify browser history. I don't
I'm building a Backbone.js app with hash based navigation. It works fine everywhere except
just wondering if there could be any issue building a shopping cart using Backbone.js
Building an app using a calendar on a Google Apps domain that has SSL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.