forked from tslocke/hobo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsmoke_test.sh
executable file
·89 lines (67 loc) · 1.51 KB
/
smoke_test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash
gems=`rake gems[build,force] | grep File: | cut -f 4 -d ' '`
full_gems=`for f in $gems ; do find . -name $f ; done`
source rvm gemset create hobo-smoke
source rvm gemset use hobo-smoke
source rvm --force gemset empty hobo-smoke
source rvm gemset use hobo-smoke
gem install --no-rdoc --no-ri $full_gems
# invite only
rm -rf smoke
hobo new smoke --setup --invite-only
cd smoke
rails s -p 3003 &
pid=$!
sleep 45
wget http://localhost:3003/
grep "Smoke" index.html
grep "Congratulations" index.html
wget http://localhost:3003/admin/users
grep "No records to display" users
grep 'Users : Smoke - Admin' users
grep "New User" users
cd ..
kill $pid || true
sleep 1
kill -9 $pid || true
echo SUCCESS
# simple setup
rm -rf smoke
hobo new smoke --setup
cd smoke
rails g hobo:resource thing name:string body:text
echo "m" > response.txt
echo "" >> response.txt
rails g hobo:migration < response.txt
rails s -p 3003 &
pid=$!
sleep 45
wget http://localhost:3003/
grep "Things" index.html
grep "Smoke" index.html
grep "Congratulations" index.html
kill $pid || true
sleep 1
kill -9 $pid || true
echo SUCCESS
cd ..
# admin subsite
rm -rf smoke
hobo new smoke --setup --add-admin-subsite
cd smoke
rails s -p 3003 &
pid=$!
sleep 45
wget http://localhost:3003/
grep "Smoke" index.html
grep "Congratulations" index.html
wget http://localhost:3003/admin/users
grep "No records to display" users
grep 'Users : Smoke - Admin' users
grep "New User" users
kill $pid || true
sleep 1
kill -9 $pid || true
echo SUCCESS
cd ..
rm -rf smoke