This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe 'PUT#update' do | |
before :each do | |
@message = create(:message, name: "Aaron Sumner", | |
email: "[email protected]") | |
end | |
it "locates the requested @message" do | |
put :update, id: @message, message: attributes_for(:message) | |
expect(assigns(:message)).to eq(@message) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe "POST#create" do | |
context "with valid attributes" do | |
it "saves the new message in the database" do | |
expect{ | |
post :create, message: attributes_for(:message) | |
}.to change(Message, :count).by(1) | |
end | |
it "redirects to the home page" do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe 'GET#edit' do | |
it "assigns the requested message to @message" do | |
message = create(:message) | |
get :edit, id: message | |
expect(assigns(:message)).to eq message | |
end | |
it "renders the :edit template" do | |
message = create(:message) | |
get :edit, id: message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe 'GET#new' do | |
it "assigns a new Message to @message" do | |
get :new | |
expect(assigns(:message)).to be_a_new(Message) | |
end | |
it "renders the :new template" do | |
get :new | |
expect(response).to render_template :new | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe 'GET#show' do | |
it "assigns the requested message to @message" do | |
message = create(:message) | |
get :show, id: message | |
expect(assigns(:message)).to eq message | |
end | |
it "renders the :show template" do | |
message = create(:message) | |
get :show, id: message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe 'GET#index' do | |
it "populates an array of messages" do | |
message = create(:message) | |
get :index | |
expect(assigns(:messages)).to match_array [message] | |
end | |
it "renders the :index view" do | |
get :index | |
response.should render_template :index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
$(function(){ | |
//Tooltip | |
$("a[data-toggle=tooltip], span[data-toggle=tooltip], .tip").tooltip(); | |
//Popover | |
$("a[data-toggle=popover], .info").popover().click(function(e) { | |
e.preventDefault() | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form class="form-horizontal"> | |
<div class="control-group"> | |
<label class="control-label" for="inputEmail">Email</label> | |
<div class="controls"> | |
<input type="text" id="inputEmail" placeholder="Email"> | |
</div> | |
</div> | |
<div class="control-group"> | |
<label class="control-label" for="inputPassword">Password</label> | |
<div class="controls"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="btn-group"> | |
<button class="btn">Left</button> | |
<button class="btn">Middle</button> | |
<button class="btn">Right</button> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Button to trigger modal --> | |
<a href="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a> | |
<!-- Modal --> | |
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> | |
<div class="modal-header"> | |
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | |
<h3 id="myModalLabel">Modal header</h3> | |
</div> | |
<div class="modal-body"> |