Skip to content

Commit c40a76b

Browse files
committed
Merge pull request #23 from gbirchmeier/i20
specs written while investigating #20
2 parents 6450f4d + 477fe1c commit c40a76b

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

spec/base_spec.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
require 'spec_helper'
2+
3+
describe ActiveAdminDatetimepicker::Base do
4+
5+
class Dummy
6+
include ActiveAdminDatetimepicker::Base
7+
end
8+
9+
let(:dummy) { Dummy.new }
10+
11+
it 'html_class' do
12+
expect(dummy.html_class).to eq "date-time-picker"
13+
end
14+
15+
it 'format' do
16+
expect(dummy.format).to eq '%Y-%m-%d %H:%M'
17+
expect(ActiveAdminDatetimepicker::Base.format).to eq '%Y-%m-%d %H:%M'
18+
end
19+
20+
end
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
require 'spec_helper'
2+
3+
describe ActiveAdmin::Inputs::DateTimePickerInput do
4+
5+
it 'included from ActiveAdminDatetimepicker::Base' do
6+
input = ActiveAdmin::Inputs::DateTimePickerInput.new(
7+
# all dummy args for now
8+
Object.new, Object.new, Object.new, Object.new, Object.new, {})
9+
expect(input.html_class).to eq "date-time-picker"
10+
expect(input.format).to eq '%Y-%m-%d %H:%M'
11+
end
12+
13+
end

0 commit comments

Comments
 (0)