mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Rails 4 updates
This commit is contained in:
@@ -13,7 +13,11 @@ describe StaticController do
|
||||
end
|
||||
|
||||
it "renders the file" do
|
||||
response.should render_template('faq')
|
||||
if rails4?
|
||||
response.should render_template('static/faq.en')
|
||||
else
|
||||
response.should render_template('faq')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -23,7 +27,11 @@ describe StaticController do
|
||||
|
||||
context "when #{setting_name} site setting is NOT set" do
|
||||
it "renders the #{id} page" do
|
||||
expect(subject).to render_template(id)
|
||||
if rails4?
|
||||
expect(subject).to render_template("static/#{id}.en")
|
||||
else
|
||||
expect(subject).to render_template(id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -147,6 +147,7 @@ describe PostMover do
|
||||
|
||||
it "copies the OP, doesn't delete it" do
|
||||
new_topic.should be_present
|
||||
new_topic.posts.reload
|
||||
new_topic.posts.first.raw.should == p1.raw
|
||||
|
||||
new_topic.reload
|
||||
|
||||
@@ -661,7 +661,7 @@ describe Topic do
|
||||
end
|
||||
|
||||
describe 'meta data' do
|
||||
let(:topic) { Fabricate(:topic, meta_data: {hello: 'world'}) }
|
||||
let(:topic) { Fabricate(:topic, meta_data: {'hello' => 'world'}) }
|
||||
|
||||
it 'allows us to create a topic with meta data' do
|
||||
topic.meta_data['hello'].should == 'world'
|
||||
@@ -671,7 +671,7 @@ describe Topic do
|
||||
|
||||
context 'existing key' do
|
||||
before do
|
||||
topic.update_meta_data(hello: 'bane')
|
||||
topic.update_meta_data('hello' => 'bane')
|
||||
end
|
||||
|
||||
it 'updates the key' do
|
||||
@@ -681,7 +681,7 @@ describe Topic do
|
||||
|
||||
context 'new key' do
|
||||
before do
|
||||
topic.update_meta_data(city: 'gotham')
|
||||
topic.update_meta_data('city' => 'gotham')
|
||||
end
|
||||
|
||||
it 'adds the new key' do
|
||||
|
||||
Reference in New Issue
Block a user