Skip to content

Commit

Permalink
Adding include to test
Browse files Browse the repository at this point in the history
  • Loading branch information
Etiene committed Jul 6, 2015
1 parent e236913 commit bf2b307
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/dev-app/tests/functional/category.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
local form = require "sailor.form"('category')
local test = require "sailor.test"

describe("Testing #CategoryController", function()
local Category = sailor.model('category')
Expand Down
33 changes: 33 additions & 0 deletions test/dev-app/tests/functional/user.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package.path = ((debug.getinfo(1).source):match('^@?(.-)/index.lua$') or '')..'../../src/?.lua;'..package.path

require "sailor"
local test = require "sailor.test"
local access = require "sailor.access"
local User = sailor.model('user')
local fixtures = require "tests.fixtures.user" or {}

describe("Testing #UserController", function()

local users
setup(function()
users = test.load_fixtures('user')
end)

it("should login", function()
assert.is_true(User.authenticate(fixtures[1].username,fixtures[1].password,false))
end)

it("should know the user is logged in", function()
assert.is_false(access.is_guest())
end)

it("should logout", function()
assert.is_true(User.logout())
end)

it("should know the user is logged out", function()
assert.is_true(access.is_guest())
end)


end)

0 comments on commit bf2b307

Please sign in to comment.