summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2013-06-23 22:55:25 -0600
committermo khan <mo@mokhan.ca>2013-06-23 22:55:25 -0600
commitd42c029d468ce13c0d8cdfc439fd7fe4c708a53b (patch)
treed81696869f5149a455eb710bec87a51d527ded61
parent1c80d6a47c18e3db67f3aecaaab88402f2afa2b6 (diff)
rename resource to link
-rw-r--r--app/admin/links.rb3
-rw-r--r--app/admin/resources.rb3
-rw-r--r--app/controllers/resources_controller.rb5
-rw-r--r--app/models/resource.rb3
-rw-r--r--app/views/resources/index.html.erb21
-rw-r--r--spec/controllers/links_controller_spec.rb11
-rw-r--r--spec/controllers/resources_controller_spec.rb11
-rw-r--r--spec/models/link_spec.rb (renamed from spec/models/resource_spec.rb)7
8 files changed, 18 insertions, 46 deletions
diff --git a/app/admin/links.rb b/app/admin/links.rb
new file mode 100644
index 0000000..f2cc1f0
--- /dev/null
+++ b/app/admin/links.rb
@@ -0,0 +1,3 @@
+ActiveAdmin.register Link do
+
+end
diff --git a/app/admin/resources.rb b/app/admin/resources.rb
deleted file mode 100644
index 78e54fa..0000000
--- a/app/admin/resources.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-ActiveAdmin.register Resource do
-
-end
diff --git a/app/controllers/resources_controller.rb b/app/controllers/resources_controller.rb
deleted file mode 100644
index 44670c2..0000000
--- a/app/controllers/resources_controller.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-class ResourcesController < ApplicationController
- def index
- @resources = Resource.all
- end
-end
diff --git a/app/models/resource.rb b/app/models/resource.rb
deleted file mode 100644
index d6fa7be..0000000
--- a/app/models/resource.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-class Resource < ActiveRecord::Base
- attr_accessible :title, :link, :description
-end \ No newline at end of file
diff --git a/app/views/resources/index.html.erb b/app/views/resources/index.html.erb
deleted file mode 100644
index 9d6a1d7..0000000
--- a/app/views/resources/index.html.erb
+++ /dev/null
@@ -1,21 +0,0 @@
-<div class="row resources">
- <div class="span12">
- <h1>Resources</h1>
- <table class="table">
- <thead>
- <tr>
- <th>Name</th>
- <th>Status</th>
- </tr>
- </thead>
- <tbody>
- <% @resources.each do |resource| %>
- <tr>
- <td><%= link_to resource.title, resource.link %></td>
- <td><%= resource.description %></td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
-</div>
diff --git a/spec/controllers/links_controller_spec.rb b/spec/controllers/links_controller_spec.rb
new file mode 100644
index 0000000..365d8c8
--- /dev/null
+++ b/spec/controllers/links_controller_spec.rb
@@ -0,0 +1,11 @@
+require 'spec_helper'
+
+describe LinksController do
+ describe :index do
+ it "should load each resource" do
+ link = Link.create!(title: 'Facebook', url: "http://www.facebook.com", description: "Everyone posts stuff on FB")
+ get :index
+ assigns(:links).should include(link)
+ end
+ end
+end
diff --git a/spec/controllers/resources_controller_spec.rb b/spec/controllers/resources_controller_spec.rb
deleted file mode 100644
index ec83d36..0000000
--- a/spec/controllers/resources_controller_spec.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-require 'spec_helper'
-
-describe ResourcesController do
- describe :index do
- it "should load each resource" do
- resource = Resource.create!(title: 'Facebook', link: "http://www.facebook.com", description: "Everyone posts stuff on FB")
- get :index
- assigns(:resources).should include(resource)
- end
- end
-end
diff --git a/spec/models/resource_spec.rb b/spec/models/link_spec.rb
index ec0b8b0..7ff7870 100644
--- a/spec/models/resource_spec.rb
+++ b/spec/models/link_spec.rb
@@ -1,10 +1,11 @@
require 'spec_helper'
-describe Resource do
+describe Link do
describe :attributes do
- subject { Resource.new }
+ subject { Link.new }
+ it { should respond_to :url }
it { should respond_to :title }
- it { should respond_to :link }
it { should respond_to :description }
+ it { should respond_to :thumbnail_url }
end
end