Skip to content

Commit d2e3f8f

Browse files
committed
update
1 parent 2db89f4 commit d2e3f8f

7 files changed

Lines changed: 114 additions & 18 deletions

File tree

app/models/organization.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ class Organization < ActiveRecord::Base
66
validates :address, presence: true
77
validates :overview, presence: true
88
validates :employee_count, presence: true, numericality: {greater_than_or_equal_to: 1}
9+
<<<<<<< 2db89f4dea0289fa69e2f4f1fe1cea229493226f
910
validates :tech_team_size, presence: true, numericality: {greater_than_or_equal_to: 1}
1011
validate :reasonable_tech_team_size
12+
=======
13+
validates :tech_team_size, presence: true, numericality: {greater_than_or_equal_to: 0}
14+
>>>>>>> validation testing
1115

1216
has_many :organization_technologies, dependent: :destroy
1317
has_many :technologies, through: :organization_technologies

app/views/layouts/application.html.erb

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -67,25 +67,23 @@
6767
<%= yield %>
6868
</div>
6969

70-
<div class="bottomMenu navbar-fixed-bottom navbar-inverse">
71-
<div class="navbar-left footer pull-left text-left">
72-
<ul class="nav navbar-nav">
73-
<li><%= link_to "About", about_path %></li>
74-
<%if user_signed_in?%>
75-
<% if current_user.missing_organization? && !current_user.admin?%>
76-
<li class="li-nav"><%= link_to "Create Organization", new_organization_path, class:"directory" %></li>
77-
<li class="user-profile"><%= link_to "Log out", sessions_path, method: :delete %></li>
78-
<% elsif !current_user.admin? %>
79-
<li class="li-nav"><%= link_to "My Organization", organization_path(current_user.organization), class:"directory" %></li>
80-
<li class="user-profile"><%= link_to "Log out", sessions_path, method: :delete %></li>
81-
<% end %>
82-
<% else %>
83-
<li><%= link_to "Create Organization", new_organization_path %></li>
84-
<li class="li-nav"><%= link_to "Sign In", new_session_path %></li>
85-
<li class="li-nav"> <%= link_to "Sign Up", new_user_path, id: "btn-sign-up" %></li>
70+
<div class="bottomMenu navbar-fixed-bottom navbar-inverse">
71+
<div class="navbar-left footer pull-left text-left">
72+
<ul class="nav navbar-nav">
73+
<li><%= link_to "About", about_path %></li>
74+
<%if user_signed_in?%>
75+
<% if current_user.missing_organization? && !current_user.admin?%>
76+
<li class="li-nav"><%= link_to "Create Organization", new_organization_path, class:"directory" %></li>
77+
<li class="user-profile"><%= link_to "Log out", sessions_path, method: :delete %></li>
78+
<% elsif !current_user.admin? %>
79+
<li class="li-nav"><%= link_to "My Organization", organization_path(current_user.organization), class:"directory" %></li>
80+
<li class="user-profile"><%= link_to "Log out", sessions_path, method: :delete %></li>
8681
<% end %>
87-
</ul>
88-
</div>
82+
<% else %>
83+
<li><%= link_to "Create Organization", new_organization_path %></li>
84+
<% end %>
85+
</ul>
86+
</div>
8987
<div class="navbar-right footer-icons">
9088
<a href="https://github.com/CodeCoreYVR/vancouvertechhub" alt="GitHub" target="_blank" ><i class="fa fa-github" aria-hidden="true"></i></a>
9189
<a href="https://twitter.com/CodeCoreYVR" alt="Twitter" target="_blank" ><i class="fa fa-twitter" aria-hidden="true"></i></a>

coverage/.last_run.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"result": {
3+
"covered_percent": 100.0
4+
}
5+
}

coverage/.resultset.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"RSpec": {
3+
"coverage": {
4+
},
5+
"timestamp": 1469123623
6+
}
7+
}

coverage/index.html

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<!DOCTYPE html>
2+
<html xmlns='http://www.w3.org/1999/xhtml'>
3+
<head>
4+
<title>Code coverage for Vancouvertechhub</title>
5+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
6+
<script src='./assets/0.10.0/application.js' type='text/javascript'></script>
7+
<link href='./assets/0.10.0/application.css' media='screen, projection, print' rel='stylesheet' type='text/css'>
8+
<link rel="shortcut icon" type="image/png" href="./assets/0.10.0/favicon_green.png" />
9+
<link rel="icon" type="image/png" href="./assets/0.10.0/favicon.png" />
10+
</head>
11+
12+
<body>
13+
<div id="loading">
14+
<img src="./assets/0.10.0/loading.gif" alt="loading"/>
15+
</div>
16+
<div id="wrapper" style="display:none;">
17+
<div class="timestamp">Generated <abbr class="timeago" title="2016-07-21T10:53:43-07:00">2016-07-21T10:53:43-07:00</abbr></div>
18+
<ul class="group_tabs"></ul>
19+
20+
<div id="content">
21+
<div class="file_list_container" id="AllFiles">
22+
<h2>
23+
<span class="group_name">All Files</span>
24+
(<span class="covered_percent"><span class="green">100.0%</span></span>
25+
covered at
26+
<span class="covered_strength">
27+
<span class="red">
28+
0.0
29+
</span>
30+
</span> hits/line)
31+
</h2>
32+
<a name="AllFiles"></a>
33+
<div>
34+
<b>0</b> files in total.
35+
<b>0.0</b> relevant lines.
36+
<span class="green"><b>0.0</b> lines covered</span> and
37+
<span class="red"><b>0.0</b> lines missed </span>
38+
</div>
39+
<table class="file_list">
40+
<thead>
41+
<tr>
42+
<th>File</th>
43+
<th>% covered</th>
44+
<th>Lines</th>
45+
<th>Relevant Lines</th>
46+
<th>Lines covered</th>
47+
<th>Lines missed</th>
48+
<th>Avg. Hits / Line</th>
49+
</tr>
50+
</thead>
51+
<tbody>
52+
53+
</tbody>
54+
</table>
55+
</div>
56+
57+
58+
59+
</div>
60+
61+
<div id="footer">
62+
Generated by <a href="http://github.com/colszowka/simplecov">simplecov</a> v0.11.2
63+
and simplecov-html v0.10.0<br/>
64+
using RSpec
65+
</div>
66+
67+
<div class="source_files">
68+
69+
</div>
70+
</div>
71+
</body>
72+
</html>

dump.rdb

0 Bytes
Binary file not shown.

spec/models/organization_spec.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@
2626
it "should have employees" do
2727
o = Organization.new FactoryGirl.attributes_for(:organization).merge({employee_count: 0})
2828
expect(o).to be_invalid
29+
it "requires the employee count to be greater than or equal to 1" do
30+
o = Organization.new employee_count: 5
31+
o.valid?
32+
expect(o.errors).to have_key(:employee_count)
33+
end
34+
35+
it "requires the tech team size to be greater than or equal to 0" do
36+
o = Organization.new tech_team_size: 5
37+
o.valid?
38+
expect(o.errors).to have_key(:tech_team_size)
2939
end
3040
end
3141
end

0 commit comments

Comments
 (0)