Created
March 18, 2010 21:12
-
-
Save drewB/336898 to your computer and use it in GitHub Desktop.
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
#--------------------------- | |
#profile_controller_spec.rb | |
#--------------------------- | |
describe ProfileController do | |
shared_examples_for "User" do | |
it "should show user profile" do | |
get :index | |
response.should be_success | |
end | |
it "should update user profile" do | |
update_profile... | |
end | |
end | |
context "MEMBER" do | |
it_should_behave_like "User" | |
it "shouldn't view someone else's profile" do | |
.... | |
end | |
end | |
context "ADMIN" do | |
it_should_behave_like "User" | |
it "should view someone else's profile" do | |
.... | |
end | |
end | |
end | |
#---------------------------- | |
#history_controller_spec.rb | |
#--------------------------- | |
describe HistoryController do | |
shared_examples_for "User" do | |
it "should show history" do | |
get :index | |
response.should be_success | |
end | |
end | |
context "MEMBER" do | |
it_should_behave_like "User" | |
it "shouldn't view someone else's history" do | |
.... | |
end | |
end | |
context "ADMIN" do | |
it_should_behave_like "User" | |
it "should view someone else's history" do | |
.... | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment