setup.rhtml
2.75 KB
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
<% @page_title = 'Setup' -%>
<% if defined?(@session_wiped) or @cleared_tables.any? or @loaded_fixtures.any? -%>
<div id="notice">
<% if defined?(@session_wiped) -%>
<p>The session is wiped clean.</p>
<% end-%>
<% if @cleared_tables.any? -%>
<p>The following database tables are cleared:</p>
<ul>
<% for table in @cleared_tables -%>
<li><%= table %></li>
<% end-%>
</ul>
<% end -%>
<% if @loaded_fixtures.any? -%>
<p>The following fixtures are loaded:</p>
<ul>
<% for fixture in @loaded_fixtures -%>
<li><%= fixture %></li>
<% end-%>
</ul>
<% end -%>
</div>
<% end -%>
<div id="usagedescription">
<p>This page can be used to setup your Selenium tests. The following options can be used:</p>
<dl>
<dt><tt>keep_session</tt></dt>
<dd>
Per default the session is reset, so add <tt>keep_session</tt> in order to keep the current session.
<table>
<tr><td>open</td><td><%= url_for %>?keep_session</td><td> </td></tr>
</table>
</dd>
<dt><tt>fixtures</tt></dt>
<dd>
Loads one or many fixtures into the database. <strong>This will destroy the current data you have in your database!</strong> Use <tt>all</tt> as name in order to load all fixtures, or specify which fixtures that should be loaded (delimited by commas).<br />
If a test needs different data than you have in your fixtures, you can add another <em>fixture set</em>. A fixture set is just a sub directory in <tt>/test/fixtures/</tt> where you can add alternate fixtures (e.g. <tt>/test/fixtures/blank/users.yml</tt>).
<table>
<tr><td>open</td><td><%= url_for :fixtures => 'all' %></td><td> </td></tr>
<tr><td>open</td><td><%= url_for :fixtures => 'fixture' %></td><td> </td></tr>
<tr><td>open</td><td><%= url_for :fixtures => 'fixture_one' %>,fixture_two</td><td> </td></tr>
</table>
<b>Available fixtures</b><br />
<% fixtures = available_fixtures -%>
<% for fixture_set in fixtures.keys.sort -%>
In the <%= fixture_set.blank? ? 'default' : "<tt>#{fixture_set}</tt>" %> fixture set:
<ul>
<% fixtures[fixture_set].unshift fixture_set.blank? ? 'all' : "#{fixture_set}/all" -%>
<% for fixture in fixtures[fixture_set] -%>
<li><tt><%= fixture %></tt></li>
<% end -%>
</ul>
<% end -%>
</dd>
<dt><tt>clear_tables</tt></dt>
<dd>
Clears one or many database tables. Another way to do the same thing is to create an empty fixture in a new fixture set (see <tt>fixtures</tt> above).
<table>
<tr><td>open</td><td><%= url_for :clear_tables => 'sessions' %></td><td> </td></tr>
<tr><td>open</td><td><%= url_for :clear_tables => 'sessions' %>,outgoing_messages</td><td> </td></tr>
</table>
</dd>
</dl>
</div>