cjsauer / accounts-phony Goto Github PK
View Code? Open in Web Editor NEWA fake login method for use in testing Meteor apps
A fake login method for use in testing Meteor apps
ChimpJS has a synchronous API, so the code samples in the README don't work. Here's what I'm doing in CoffeeScript:
module.exports = ->
ROOT_URL = 'http://localhost:3000'
login = (done) -> Meteor.loginWithPhony Package['csauer:accounts-phony'].Phony.user, done
@Given 'I am logged in', ->
@browser.url(ROOT_URL)
@browser.timeoutsAsyncScript(5000)
@browser.executeAsync(login)
@Given 'I am on the Dashboard', -> @browser.url("#{ROOT_URL}/dashboard")
@Then 'I can see my widgets', -> @browser.waitForExist("<my DOM selector>").should.equal(true)
Note: This is running with --chai
so uses should
instead of Jasmine's expect()
.
Also I probably shouldn't be writing localhost:3000
, but that's another story.
Hi!
I'm sure this is just a simple user error. But I'm having trouble import this package into my test files.
I'm using var Phony = Package['csauer:accounts-phony'].Phony;
as specified in the README.
But when I try calling loginWithPhony
I get "Meteor.loginWithPhony is not a function"
Hello,
I think I just need a clarification, because I'm not sure about what I can do with this package, and what I cannot do.
I need to "fake a login" in Meteor to unit-test roles and page access. So I'm logging with Phony, Meteor.userId()
returns the correct _id of the fake user I logged in, but Meteor.user()
returns undefined
Have I done something wrong or is this package not about the problem I try to solve?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.