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

  • Home
  • SEARCH
  • 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 8096387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:26:18+00:00 2026-06-05T21:26:18+00:00

To run the spec files & assets as coffee script, I decided to go

  • 0

To run the spec files & assets as coffee script, I decided to go with jasmine-headless-webkit. I believe I have everything installed correctly, but perhaps something wrong in my jasmine.yml file:

src_files:
  - spec/support/javascripts/jquery-1.7.2.js
  - app/assets/javascripts/application.js
helpers:
  - helpers/**/*
spec_files:
  - "**/*_spec.*"
src_dir: 
  - vendor/assets/javascripts
spec_dir: spec/javascripts

When I run the command, I get three errors, all along the same lines:

Editor should have an array named tables. (/Users/aaronmcleod/Documents/awesome_model/spec/javascripts/editor_spec.js.coffee:20)
ReferenceError: Can't find variable: AwesomeModel

The AwesomeModel variable is my hash I’m using that I export to the window object. I then attach things like the Editor class to it. Any ideas as to why this isn’t defined? Here’s my spec file if it helps:

fixture_text = ->
  "Company has_many:Employee\n" +
  "  id : int\n" +
  "  name : varchar\n" +
  "Employee belongs_to:Company\n" +
  "  id : int\n" +
  "  name : varchar\n" +
  "  phone : varchar\n" +
  "ComplicatedTable-Name\n" +
  "  id : int"

class DummyPane
  constructor: ->
    @viewport = {}

  clean_up: ->

describe "Editor", ->

  it "should have an array named tables", ->
    editor = new AwesomeModel.Editor(fixture_text())
    expect(editor.tables).toBeDefined()

  describe "#parse_table_names", ->
    text = fixture_text()
    editor = new AwesomeModel.Editor(text)

    it "tables should be of three length", ->
      editor.parse_table_names()
      expect(editor.tables.length).toEqual(3)

    it "the first table name should be 'Company'", ->
      editor.parse_table_names()
      expect(editor.tables[0].name).toEqual("Company")

    it "the third table name should be 'ComplicatedTable-Name'", ->
      editor.parse_table_names()
      expect(editor.tables[2].name).toEqual("ComplicatedTable-Name")

  describe "#add_columns", ->
    text = fixture_text()
    editor = new AwesomeModel.Editor(text)
    editor.parse_table_names()

    describe "first table", ->
      it "the first table should have two columns", ->
        editor.add_columns()
        table = editor.tables[0]

        expect(table.columns.length).toEqual(2)

      it "the first column of first table should be named 'id : int'", ->
        editor.add_columns
        table = editor.tables[0]
        expect(table.columns[0].name).toEqual('id : int')
  • 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-06-05T21:26:19+00:00Added an answer on June 5, 2026 at 9:26 pm

    Found an answer by utilizing guard. No changes to the spec file, a few minor changes to the jasmine.yml file. Here’s my gemfile:

    source 'https://rubygems.org'
    
    gem 'rails', '3.2.0'
    
    # Bundle edge Rails instead:
    # gem 'rails', :git => 'git://github.com/rails/rails.git'
    
    # Gems used only for assets and not required
    # in production environments by default.
    group :assets do
      gem 'sass-rails',   '~> 3.2.3'
      gem 'coffee-rails', '~> 3.2.1'
    
      # See https://github.com/sstephenson/execjs#readme for more supported runtimes
      # gem 'therubyracer'
    
      gem 'uglifier', '>= 1.0.3'
    end
    
    gem 'haml-rails'
    
    gem 'jquery-rails'
    
    platforms :ruby do
      gem 'pg'
    end
    
    platforms :jruby do
      gem 'jruby-openssl'
      gem 'activerecord-jdbcpostgresql-adapter'
    end
    
    group :test, :development do
      gem 'rspec-rails'
      gem 'capybara'
      gem 'jasmine'
      gem 'guard'
      gem 'guard-coffeescript'
    end
    

    My guardfile:

    # A sample Guardfile
    # More info at https://github.com/guard/guard#readme
    
    guard 'coffeescript', input: 'spec/javascripts', output: 'spec/javascripts'
    

    Jasmine.yml

    src_dir: 
      - assets/javascripts
    src_files:
      - assets/application.js
    helpers:
      - helpers/**/*
    spec_files:
      - "**/*_spec.js"
    
    spec_dir: spec/javascripts
    

    I changed the assets path to not use the local folder structure, but the asset path properly.

    To run this, just run guard in one tab, and rake jasmine in another. As you save spec files, the .js version will be compiled by guard.

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

Sidebar

Related Questions

I'm trying to test some backbone.js views using Jasmine (via jasmine-headless-webkit). Everything is working
I have a rails 3.1 project that I'd like to run some jasmine specs
I have just installed Rspec and Rspec-rails. When i try to run the test,
I am trying to use rspec on my rails application I run spec path/to/spec/spec.rb
I run the following command to link the different files in my project. /opt/gcc-4.7-cilkplus/bin/gcc
I run this code here <html> <script type=text/javascript src=lib/jquery-ui-1.8.21.custom.min.js></script> <script src=http://127.0.0.1:5984/_utils/script/jquery.couch.js></script> <!--<script type=text/javascript src=lib/jquery-1.7.2.js></script>-->
I run into this problem. I have a textarea which I only want to
We have a config spec that we use for our builds that we encourage
When I run rspec spec I get the following: /usr/local/lib/ruby/gems/1.9.1/gems/rspec-rails-2.7.0/lib/rspec/rails/extensions/active_record/base.rb:26:in `': uninitialized constant ActiveModel
I have been working and tinkering with Nokogiri, REXML & Ruby for a month.

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.