Permalink
Browse files

Done till 5.3.4

  • Loading branch information...
1 parent c22e5e4 commit 76d9ab66fcaba02ee6796c38e293fa91cea77642 Hanif, Hakimuddin committed May 14, 2014
@@ -1,13 +1,18 @@
@import "bootstrap";
+/* mixins, variables, etc. */
+
+$grayMediumLight: #eaeaea;
+$grayLight: #999;
+
/* universal */
html {
overflow-y: scroll;
}
body {
- padding-top: 50px;
+ padding-top: 60px;
}
section {
@@ -20,13 +25,11 @@ textarea {
.center {
text-align: center;
+ h1 {
+ margin-bottom: 10px;
+ }
}
-.center h1 {
- margin-bottom: 10px;
-}
-
-
/* typography */
h1, h2, h3, h4, h5, h6 {
@@ -46,60 +49,55 @@ h2 {
margin-bottom: 30px;
text-align: center;
font-weight: normal;
- color: #999;
+ color: $grayLight;
}
p {
font-size: 1.1em;
line-height: 1.7em;
}
+
/* header */
#logo {
float: left;
margin-right: 10px;
font-size: 1.7em;
- color: #fff;
+ color: white;
text-transform: uppercase;
letter-spacing: -1px;
padding-top: 9px;
font-weight: bold;
line-height: 1;
-}
-
-#logo:hover {
- color: #fff;
- text-decoration: none;
+ &:hover {
+ color: white;
+ text-decoration: none;
+ }
}
/* footer */
footer {
margin-top: 45px;
padding-top: 5px;
- border-top: 1px solid #eaeaea;
- color: #999;
-}
-
-footer a {
- color: #555;
-}
-
-footer a:hover {
- color: #222;
-}
-
-footer small {
- float: left;
-}
-
-footer ul {
- float: right;
- list-style: none;
-}
-
-footer ul li {
- float: left;
- margin-left: 10px;
+ border-top: 1px solid $grayMediumLight;
+ color: $grayLight;
+ a {
+ color: $gray;
+ &:hover {
+ color: $gray-darker;
+ }
+ }
+ small {
+ float: left;
+ }
+ ul {
+ float: right;
+ list-style: none;
+ li {
+ float: left;
+ margin-left: 10px;
+ }
+ }
}
@@ -7,4 +7,7 @@ def help
def aboutus
end
+
+ def contact
+ end
end
@@ -5,8 +5,8 @@
</small>
<nav>
<ul>
- <li><%= link_to "About", '#' %></li>
- <li><%= link_to "Contact", '#' %></li>
+ <li><%= link_to "About", about_path %></li>
+ <li><%= link_to "Contact", contact_path %></li>
<li><a href="http://news.railstutorial.org/">News</a></li>
</ul>
</nav>
@@ -4,9 +4,8 @@
</div>
<div>
<ul class="nav navbar-nav pull-right">
- <li><%= link_to "Home", '#' %></li>
- <li><%= link_to "Help", '#' %></li>
- <li><%= link_to "Sign in", '#' %></li>
+ <li><%= link_to "Home", root_path %></li>
+ <li><%= link_to "Help", help_path %></li>
</ul>
</div>
</header>
@@ -0,0 +1,6 @@
+<% provide(:title, 'Contact') %>
+<h1>Contact</h1>
+<p>
+ Contact Ruby on Rails Tutorial about the sample app at the
+ <a href="http://railstutorial.org/contact">contact page</a>.
+</p>
View
@@ -1,7 +1,9 @@
SampleApp::Application.routes.draw do
- get "static_pages/home"
- get "static_pages/help"
- get "static_pages/aboutus"
+ root 'static_pages#home'
+ match '/help', to: 'static_pages#help', via: 'get'
+ match '/about', to: 'static_pages#aboutus', via: 'get'
+ match '/contact', to: 'static_pages#contact', via: 'get'
+
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".
@@ -2,39 +2,35 @@
describe "Static pages" do
+ subject { page }
+
describe "Home page" do
+ before { visit root_path }
- it "should have content 'Sample app'" do
- # Run the generator again with the --webrat flag if you want to use webrat methods/matchers
- visit '/static_pages/home'
+ it { should have_content('Sample App') }
+ it { should have_title("Home") }
+ end
- expect(page).to have_content('Sample App')
- end
+ describe "Help page" do
+ before {visit help_path}
- it "should have title Home" do
- # Run the generator again with the --webrat flag if you want to use webrat methods/matchers
- visit '/static_pages/home'
+ it { should have_content('Help') }
- expect(page).to have_title("Home")
- end
end
- describe "Help page" do
+ describe "About page" do
- it "should have content Help" do
- visit '/static_pages/help'
- expect(page).to have_content('Help')
- end
+ before { visit about_path }
+ it { should have_content('About Us') }
end
- describe "About page" do
+ describe "Contact page" do
- it "should have content 'About Us'" do
- visit '/static_pages/aboutus'
- expect(page).to have_content('About Us')
- end
+ before { visit contact_path }
+ it { should have_content('Contact') }
+ it { should have_title("Contact") }
end
end

0 comments on commit 76d9ab6

Please sign in to comment.