Skip to content

Commit 4e09b79

Browse files
committed
done
1 parent 1a53354 commit 4e09b79

File tree

12 files changed

+95
-1
lines changed

12 files changed

+95
-1
lines changed

README

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Rails-portlets is a portlet example of apotomo gem(http://apotomo.de). The live
77

88
1. bundle install
99

10-
1110
2. rails server
1211

1312

app/models/tweet.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class Tweet < ActiveRecord::Base
2+
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
= widget_div do
2+
%h1
3+
TrashbinWidget#display
4+
%p
5+
Find me in app/widgets/trashbin/display.html.haml

app/widgets/trashbin_widget.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class TrashbinWidget < Apotomo::Widget
2+
3+
def display
4+
render
5+
end
6+
7+
end

app/widgets/twitter/display.html.haml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
= widget_div do
2+
%h1
3+
TwitterWidget#display
4+
%p
5+
Find me in app/widgets/twitter/display.html.haml

app/widgets/twitter_widget.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class TwitterWidget < Apotomo::Widget
2+
3+
def display
4+
render
5+
end
6+
7+
end
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class CreateTweets < ActiveRecord::Migration
2+
def change
3+
create_table :tweets do |t|
4+
t.string :text
5+
6+
t.timestamps
7+
end
8+
end
9+
end

db/schema.rb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# encoding: UTF-8
2+
# This file is auto-generated from the current state of the database. Instead
3+
# of editing this file, please use the migrations feature of Active Record to
4+
# incrementally modify your database, and then regenerate this schema definition.
5+
#
6+
# Note that this schema.rb definition is the authoritative source for your
7+
# database schema. If you need to create the application database on another
8+
# system, you should be using db:schema:load, not running all the migrations
9+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
10+
# you'll amass, the slower it'll run and the greater likelihood for issues).
11+
#
12+
# It's strongly recommended to check this file into your version control system.
13+
14+
ActiveRecord::Schema.define(:version => 20111008222731) do
15+
16+
create_table "tweets", :force => true do |t|
17+
t.string "text"
18+
t.datetime "created_at"
19+
t.datetime "updated_at"
20+
end
21+
22+
end

test/fixtures/tweets.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Read about fixtures at http://api.rubyonrails.org/classes/Fixtures.html
2+
3+
one:
4+
text: MyString
5+
6+
two:
7+
text: MyString

test/unit/tweet_test.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require 'test_helper'
2+
3+
class TweetTest < ActiveSupport::TestCase
4+
# test "the truth" do
5+
# assert true
6+
# end
7+
end

test/widgets/trashbin_widget_test.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
require 'test_helper'
2+
3+
class TrashbinWidgetTest < Apotomo::TestCase
4+
has_widgets do |root|
5+
root << widget(:trashbin, 'me')
6+
end
7+
8+
test "display" do
9+
render_widget 'me'
10+
assert_select "h1"
11+
end
12+
end

test/widgets/twitter_widget_test.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
require 'test_helper'
2+
3+
class TwitterWidgetTest < Apotomo::TestCase
4+
has_widgets do |root|
5+
root << widget(:twitter, 'me')
6+
end
7+
8+
test "display" do
9+
render_widget 'me'
10+
assert_select "h1"
11+
end
12+
end

0 commit comments

Comments
 (0)