updated gitignore, added wrongly ignored files

This commit is contained in:
Matthew Scragg 2014-10-09 16:30:34 -05:00
parent 672856e9af
commit 142050d804
3 changed files with 64 additions and 2 deletions

4
.gitignore vendored
View file

@ -12,6 +12,6 @@ config.sls
config.json config.json
realms/static/vendor realms/static/vendor
realms/static/assets/* realms/static/assets/*
wiki.db /wiki.db
wiki /wiki
npm-debug.log npm-debug.log

View file

@ -0,0 +1,32 @@
from nose.tools import *
from flask import url_for
from realms import app, g
from realms.modules.wiki.models import Wiki, cname_to_filename, filename_to_cname
from flask.ext.testing import TestCase
class WikiTest(TestCase):
def create_app(self):
app.config['TESTING'] = True
return app
def test_wiki_routes(self):
self.assert_200(self.client.get(url_for("wiki.create")))
for route in ['page', 'edit', 'history', 'index']:
rv = self.client.get(url_for("wiki.%s" % route, name='test'))
self.assert_200(rv, "wiki.%s: %s" % (route, rv.status_code))
def test_write_page(self):
pass
def test_revert(self):
pass
def test_cname_to_filename(self):
eq_(cname_to_filename('test'), 'test.md')
def test_filename_to_cname(self):
eq_(filename_to_cname('test-1-2-3.md'), 'test-1-2-3')

View file

@ -0,0 +1,30 @@
{% extends 'layout.html' %}
{% block js %}
<script>
$(document).ready(function() {
$('.data-table').dataTable();
});
</script>
{% endblock %}
{% block body %}
<table class="table table-bordered data-table">
<thead>
<tr>
<th>Name</th>
<th class="hidden-xs">Bytes</th>
<th>Modified</th>
<th class="hidden-xs hidden-sm">Created</th>
</tr>
</thead>
{% for file in index %}
<tr>
<td><a href="{{ url_for('wiki.page', name=file['name']) }}">{{ file['name'] }}</a></td>
<td class="hidden-xs">{{ file['size'] }}</td>
<td>{{ file['ctime']|datetime }}</td>
<td class="hidden-xs hidden-sm">{{ file['mtime']|datetime }}</td>
</tr>
{% endfor %}
</table>
{% endblock %}