Permalink
Browse files

building more tests

  • Loading branch information...
1 parent e29b65e commit 40ff1a8241d5f579c708626af553a5df94db4b4b @myf myf committed Sep 4, 2012
@@ -153,7 +153,6 @@ if root.Meteor.is_client
#########GRAPH###############################
root.Template.graph.events =
"click .deletionBtn": ->
- console.log "hello"
url = Session.get("currentDatasetURL")
user = Session.get("currentUser")
field = this.field
@@ -12,7 +12,7 @@ describe("Array FAIL Spec", function() {
//demonstrates use of expected exceptions
describe("#indexOf", function() {
it("should find 1 in [2,2,3]", function() {
- expect([2,2,3].indexOf(1)).toEqual(0);
+ expect([2,2,3].indexOf(3)).toEqual(2);
});
});
@@ -1,8 +1,43 @@
load_test=->
+ testing_url = "https://www.dropbox.com/s/0m8smn04oti92gr/sample_dataset_school_survey.csv?dl=1"
describe "register URL", ->
+ #SESSION############################
Session.set "currentDatasetURL", "https://www.dropbox.com/s/0m8smn04oti92gr/sample_dataset_school_survey.csv?dl=1"
+
+ #TEST###############################
describe "url", ->
it "should find url after registeration", ->
url = Session.get "currentDatasetURL"
expect(url).toEqual("https://www.dropbox.com/s/0m8smn04oti92gr/sample_dataset_school_survey.csv?dl=1")
+ it "should find Preparing block", ->
+ h1 = $("h1")
+ expect(h1.text()).toEqual("Preparing your dataset, just a split second..")
+
+ #SESSION######################################
+ Meteor.call('register_dataset', testing_url, (error, result)->
+ if error
+ alert error.reason
+ interval = setInterval(->
+ if Schemas.findOne(datasetURL: testing_url)
+ console.log "booya"
+ Meteor.call("get_fields", testing_url)
+ ##testing####################
+ describe "database registration", ->
+ it "should have a dataset object", ->
+ dataset = Datasets.findOne()
+ expect(dataset.url).toEqual(testing_url)
+ it "should have a schema object", ->
+ schema = Schemas.findOne()
+ expect(schema.datasetURL).toEqual(testing_url)
+
+ describe "getting fields", ->
+ it "should have all the fields", ->
+ fileds = Session.get("fields")
+ expect(fields).toEqual(["grade","sex","name","income"])
+
+
+
+ clearInterval(interval)
+ ,300)
+ )
@@ -3,7 +3,7 @@ require = __meteor_bootstrap__.require
request = require 'request'
#bambooURL = 'http://localhost:8080'
#bambooURL = 'http://bamboo.modilabs.org/'
-bambooURL = 'http://dev.bamboo.io/'
+bambooURL = 'http://dev.bamboo.io'
#bambooURL = 'http://starscream.modilabs.org:8080/'
datasetsURL = bambooURL + '/datasets'
summaryURLf = (id,group) -> datasetsURL + '/' + id + '/summary' +

0 comments on commit 40ff1a8

Please sign in to comment.